summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/globe.h4
-rw-r--r--qt-ui/maintab.cpp2
-rw-r--r--qt-ui/subsurfacewebservices.cpp8
3 files changed, 12 insertions, 2 deletions
diff --git a/qt-ui/globe.h b/qt-ui/globe.h
index 31683dc35..903b9f89c 100644
--- a/qt-ui/globe.h
+++ b/qt-ui/globe.h
@@ -1,8 +1,9 @@
#ifndef GLOBE_H
#define GLOBE_H
-#ifndef NO_MARBLE
#include <stdint.h>
+
+#ifndef NO_MARBLE
#include <marble/MarbleWidget.h>
#include <marble/GeoDataCoordinates.h>
@@ -64,6 +65,7 @@ public:
void reload();
void repopulateLabels();
void centerOnDiveSite(uint32_t uuid);
+ void centerOnCurrentDive();
bool eventFilter(QObject *, QEvent *);
public
slots:
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 55b01a29f..8b141a16f 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -999,8 +999,10 @@ void MainTab::rejectChanges()
DivePictureModel::instance()->updateDivePictures();
// the user could have edited the location and then canceled the edit
// let's get the correct location back in view
+#ifndef NO_MARBLE
MainWindow::instance()->globe()->centerOnDiveSite(displayed_dive.dive_site_uuid);
MainWindow::instance()->globe()->reload();
+#endif
// show the profile and dive info
MainWindow::instance()->graphics()->replot();
MainWindow::instance()->setEnabledToolbar(true);
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 6aadc2de7..6050782b2 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -85,6 +85,7 @@ static bool merge_locations_into_dives(void)
*/
if ((dive->when + dive->duration.seconds - gpsfix->when) < (nextgpsfix->when - gpsfix->when)) {
copy_gps_location(gpsfix, dive);
+ changed++;
tracer = j;
break;
}
@@ -346,8 +347,11 @@ void SubsurfaceWebServices::buttonClicked(QAbstractButton *button)
/* now merge the data in the gps_location table into the dive_table */
if (merge_locations_into_dives()) {
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();
}
@@ -378,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: