From 74f3961b055741e96f0c4262d639f007de0623f4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 9 Jun 2015 14:35:27 -0700 Subject: [PATCH] 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 --- qt-ui/subsurfacewebservices.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 12531f6b3..5e7f016dd 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -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: