mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
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>
This commit is contained in:
parent
2a110811cf
commit
d24de5b72b
1 changed files with 11 additions and 5 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue