mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: use getDiveSelection() to loop over selected dives
getDiveSelection() returns a vector of the selected dives. Use that instead of looping over the dive table and checking manually. This removes a few lines of code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
7b196a5ef9
commit
00abc04913
4 changed files with 18 additions and 53 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "exif.h"
|
||||
#include "file.h"
|
||||
#include "picture.h"
|
||||
#include "selection.h"
|
||||
#include "tag.h"
|
||||
#include "trip.h"
|
||||
#include "imagedownloader.h"
|
||||
|
@ -387,12 +388,9 @@ static bool lessThan(const QPair<QString, int> &a, const QPair<QString, int> &b)
|
|||
|
||||
QVector<QPair<QString, int>> selectedDivesGasUsed()
|
||||
{
|
||||
int i, j;
|
||||
struct dive *d;
|
||||
int j;
|
||||
QMap<QString, int> gasUsed;
|
||||
for_each_dive (i, d) {
|
||||
if (!d->selected)
|
||||
continue;
|
||||
for (dive *d: getDiveSelection()) {
|
||||
volume_t *diveGases = get_gas_used(d);
|
||||
for (j = 0; j < d->cylinders.nr; j++) {
|
||||
if (diveGases[j].mliter) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue