Discard all temporary sites after merging with dive list

After we import all the GPS fixes from the Subsurfae webservice we delete
the ones that didn't match any dives. The algorithm skipped every other
one by mistake.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-06-09 14:35:27 -07:00
parent e19fa0a9f3
commit 74f3961b05

View file

@ -382,8 +382,10 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button)
usedUuids.insert(d->dive_site_uuid);
}
for_each_dive_site(i, ds) {
if (!usedUuids.contains(ds->uuid) && same_string(ds->notes, "SubsurfaceWebservice"))
if (!usedUuids.contains(ds->uuid) && same_string(ds->notes, "SubsurfaceWebservice")) {
delete_dive_site(ds->uuid);
i--; // otherwise we skip one site
}
}
} break;
case QDialogButtonBox::RejectRole: