Settings update: Simplify code by using the SettingsObjectHelper

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2016-08-25 15:22:04 -03:00 committed by Dirk Hohndel
parent 83236f7e9e
commit 5651abfd75

View file

@ -231,13 +231,9 @@ QMLManager *QMLManager::instance()
void QMLManager::savePreferences()
{
QSettings s;
s.beginGroup("LocationService");
s.setValue("time_threshold", timeThreshold() * 60);
prefs.time_threshold = timeThreshold() * 60;
s.setValue("distance_threshold", distanceThreshold());
prefs.distance_threshold = distanceThreshold();
s.sync();
auto location = SettingsObjectWrapper::instance()->location_settings;
location->setTimeThreshold(timeThreshold() * 60);
location->setDistanceThreshold(distanceThreshold());
}
#define CLOUDURL QString(prefs.cloud_base_url)