summaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r--qt-ui/modeldelegates.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 516ada3ce..268312a4d 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -11,6 +11,9 @@
#include "weightmodel.h"
#include "divetripmodel.h"
#include "qthelper.h"
+#ifndef NO_MARBLE
+#include "globe.h"
+#endif
#include <QCompleter>
#include <QKeyEvent>
@@ -520,6 +523,13 @@ void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem
free( (void*) gpsCoords);
}
+#ifndef NO_MARBLE
+ if ((option.state & QStyle::State_HasFocus) && dive_site_has_gps_location(ds)) {
+ qDebug() << "center on" << ds->name;
+ MainWindow::instance()->globe()->centerOnDiveSite(ds->uuid);
+ }
+#endif
+
if (dive_site_has_gps_location(ds) && dive_site_has_gps_location(&displayed_dive_site)) {
// so we are showing a completion and both the current dive site and the completion
// have a GPS fix... so let's show the distance