Revert the singleton PR

It turns out that this isn't working the way it was intended to.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-09-27 16:26:54 -07:00
parent 400b218f76
commit 9ae7040a91
15 changed files with 118 additions and 89 deletions

View file

@ -44,6 +44,7 @@
#include "core/settings/qPrefUnit.h"
#include "core/trip.h"
QMLManager *QMLManager::m_instance = NULL;
bool noCloudToCloud = false;
#define RED_FONT QLatin1Literal("<font color=\"red\">")
@ -149,6 +150,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
m_showNonDiveComputers(false)
{
LOG_STP("qmlmgr starting");
m_instance = this;
m_lastDevicePixelRatio = qApp->devicePixelRatio();
timer.start();
connect(qobject_cast<QApplication *>(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged);
@ -449,6 +451,12 @@ QMLManager::~QMLManager()
if (appLogFileOpen)
appLogFile.close();
#endif
m_instance = NULL;
}
QMLManager *QMLManager::instance()
{
return m_instance;
}
#define CLOUDURL QString(prefs.cloud_base_url)
@ -1556,7 +1564,7 @@ void QMLManager::applyGpsData()
void QMLManager::populateGpsData()
{
if (GpsListModel::instance())
GpsListModel::instance()->update(QVector<gpsTracker>::fromList(locationProvider->currentGPSInfo().values()));
GpsListModel::instance()->update();
}
void QMLManager::clearGpsData()