mobile: turn GpsLocation into a regular singleton construct

Simply move the initialization of the logging function into its own method and
call that in the QMLManager constructor.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2021-01-01 12:55:47 -08:00
parent 53b572f987
commit 5048a695aa
3 changed files with 13 additions and 20 deletions

View file

@ -290,7 +290,8 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
this, &QMLManager::btHostModeChange);
}
// create location manager service
locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
locationProvider = GpsLocation::instance();
locationProvider->setLogCallBack(&appendTextToLogStandalone);
progress_callback = &progressCallback;
connect(locationProvider, SIGNAL(haveSourceChanged()), this, SLOT(hasLocationSourceChanged()));
setLocationServiceAvailable(locationProvider->hasLocationsSource());