diff options
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r-- | qt-ui/globe.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index c1abd082f..bf2369862 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -1,6 +1,7 @@ #include "globe.h" #include "kmessagewidget.h" #include "../dive.h" +#include "../helpers.h" #include <QDebug> @@ -9,6 +10,7 @@ #include <marble/GeoDataDocument.h> #include <marble/MarbleModel.h> #include <marble/MarbleDirs.h> +#include <marble/MapThemeManager.h> #if INCOMPLETE_MARBLE #include "marble/GeoDataTreeModel.h" #else @@ -19,9 +21,21 @@ GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0) { - // this will find the Google maps when running from your build directory - // TODO: all the magic to find the install path (and actually install/bundle these files) - MarbleDirs::setMarbleDataPath(QDir("./marbledata").absolutePath()); + // check if Google Sat Maps are installed + // if not, check if they are in a known location + MapThemeManager mtm; + QStringList list = mtm.mapThemeIds(); + QString theme, subsurfaceDataPath; + QDir marble; + bool foundGoogleMap = false; + Q_FOREACH(theme, list) + if (theme == "earth/googlesat/googlesat.dgml") + foundGoogleMap = true; + if (!foundGoogleMap) { + subsurfaceDataPath = getSubsurfaceDataPath("marbledata"); + if (subsurfaceDataPath != "") + MarbleDirs::setMarbleDataPath(subsurfaceDataPath); + } messageWidget = new KMessageWidget(this); messageWidget->setCloseButtonVisible(false); messageWidget->setHidden(true); |