diff options
author | Tomaz Canabrava <tomaz.canabrava@gmail.com> | 2015-07-30 21:51:38 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-31 10:28:17 -0700 |
commit | 7efa924067942e6ad32894454e90bf7c5c99a5ae (patch) | |
tree | e2b55d2ed2811fa54fd3ddee7315f7e8e15b4d4f /qt-ui/maintab.cpp | |
parent | 9130ff8a97ea73e92dccd68f8107f441cb0a3f7e (diff) | |
download | subsurface-7efa924067942e6ad32894454e90bf7c5c99a5ae.tar.gz |
Transform GlobeGPS in a static instance() class
This is needed to start easing the transition from the completely
wrong and bogus MainWindow::instance()->globe() calls. this is still
wrong, but with it I removed one level of indirection.
I did that now because I wanted to not taint the location management
when I use it to deal with the globe.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 4b6f961c1..369a754bc 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -463,7 +463,7 @@ void MainTab::updateDiveInfo(bool clear) // I don't like this code here - but globe() wasn't initialized on the constructor. { QListView *completerListview = qobject_cast<QListView*>(ui.location->completer()->popup()); - connect(completerListview, SIGNAL(entered(QModelIndex)), MainWindow::instance()->globe(), SLOT(centerOnIndex(QModelIndex)), Qt::UniqueConnection); + connect(completerListview, SIGNAL(entered(QModelIndex)), GlobeGPS::instance(), SLOT(centerOnIndex(QModelIndex)), Qt::UniqueConnection); } EditMode rememberEM = editMode; @@ -1208,8 +1208,7 @@ void MainTab::rejectChanges() // 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(get_dive_site_by_uuid(displayed_dive.dive_site_uuid)); - MainWindow::instance()->globe()->reload(); + GlobeGPS::instance()->centerOnDiveSite(get_dive_site_by_uuid(displayed_dive.dive_site_uuid)); #endif // show the profile and dive info MainWindow::instance()->graphics()->replot(); |