diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-10 07:09:23 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-10 07:09:23 -0700 |
commit | d24de5b72b69d6a114654706f6f7821b73bf4400 (patch) | |
tree | 2a666320f88890a7d72d8d36ded2e89082b9eea3 /qt-ui/subsurfacewebservices.cpp | |
parent | 2a110811cfac88891375007db42de6e48ae83e3d (diff) | |
download | subsurface-d24de5b72b69d6a114654706f6f7821b73bf4400.tar.gz |
Don't show all the auto generated dive sites on the globe
When downloading GPS data from the Subsurface webservice we repopulated
the globe before purging all the unused GPS fixes from the list of dive
sites which caused massive clutter (until the next time the user changed
the displayed dive or did anything else that caused the globe to redraw
itself).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 6050782b2..825d4f03d 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -334,6 +334,7 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button) int i; struct dive *d; struct dive_site *ds; + bool changed = false; clear_table(&gps_location_table); QByteArray url = tr("Webservice").toLocal8Bit(); parse_xml_buffer(url.data(), downloadedData.data(), downloadedData.length(), &gps_location_table, NULL); @@ -346,12 +347,8 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button) } /* now merge the data in the gps_location table into the dive_table */ if (merge_locations_into_dives()) { + changed = true; mark_divelist_changed(true); -#ifndef NO_MARBLE - - MainWindow::instance()->globe()->repopulateLabels(); - MainWindow::instance()->globe()->centerOnDiveSite(current_dive->dive_site_uuid); -#endif MainWindow::instance()->information()->updateDiveInfo(); } @@ -387,6 +384,15 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button) i--; // otherwise we skip one site } } +#ifndef NO_MARBLE + // finally now that all the extra GPS fixes that weren't used have been deleted + // we can update the globe + if (changed) { + MainWindow::instance()->globe()->repopulateLabels(); + MainWindow::instance()->globe()->centerOnDiveSite(current_dive->dive_site_uuid); + } +#endif + } break; case QDialogButtonBox::RejectRole: if (reply != NULL && reply->isOpen()) { |