mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
9130ff8a97
commit
7efa924067
6 changed files with 20 additions and 21 deletions
|
@ -24,6 +24,12 @@
|
|||
#include <marble/MarbleDebug.h>
|
||||
#endif
|
||||
|
||||
GlobeGPS *GlobeGPS::instance()
|
||||
{
|
||||
static GlobeGPS *self = new GlobeGPS();
|
||||
return self;
|
||||
}
|
||||
|
||||
GlobeGPS::GlobeGPS(QWidget *parent) : MarbleWidget(parent),
|
||||
loadedDives(0),
|
||||
messageWidget(new KMessageWidget(this)),
|
||||
|
@ -378,9 +384,9 @@ void GlobeGPS::centerOnIndex(const QModelIndex& idx)
|
|||
{
|
||||
struct dive_site *ds = get_dive_site_by_uuid(idx.model()->index(idx.row(), 0).data().toInt());
|
||||
if (!ds || !dive_site_has_gps_location(ds))
|
||||
MainWindow::instance()->globe()->centerOnDiveSite(&displayed_dive_site);
|
||||
centerOnDiveSite(&displayed_dive_site);
|
||||
else
|
||||
MainWindow::instance()->globe()->centerOnDiveSite(ds);
|
||||
centerOnDiveSite(ds);
|
||||
}
|
||||
#else
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue