diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-09 14:35:27 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-09 14:35:27 -0700 |
commit | 74f3961b055741e96f0c4262d639f007de0623f4 (patch) | |
tree | 732404f6bc8427425b566842d55f11cd5811fb57 /qt-ui/subsurfacewebservices.cpp | |
parent | e19fa0a9f325bdf6750376130f89a15df64875f4 (diff) | |
download | subsurface-74f3961b055741e96f0c4262d639f007de0623f4.tar.gz |
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>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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: |