summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/SettingsObjectWrapper.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-08-06 17:36:29 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-12 11:30:19 -0700
commit75ce813a27fc22fca8e4b1c7484333235c9caea6 (patch)
treee28a6d118bee66886051d47e0f00d7644679a4b2 /core/subsurface-qt/SettingsObjectWrapper.cpp
parent2b11fd4cc8fca46152bc8c3c0b53658694cfd5bf (diff)
downloadsubsurface-75ce813a27fc22fca8e4b1c7484333235c9caea6.tar.gz
core: activate qPrefLocationService
remove LocationService from SettingsObjectWrapper and reference qPrefLocationService update files using SettingsObjectWrapper/LocationService to use qPrefLocationService this activated qPrefLocationService and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/subsurface-qt/SettingsObjectWrapper.cpp')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp45
1 files changed, 2 insertions, 43 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 224e314a5..84ffc5a26 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -532,44 +532,6 @@ void LanguageSettingsObjectWrapper::setDateFormatOverride(bool value)
}
-LocationServiceSettingsObjectWrapper::LocationServiceSettingsObjectWrapper(QObject* parent):
- QObject(parent)
-{
-}
-
-int LocationServiceSettingsObjectWrapper::distanceThreshold() const
-{
- return prefs.distance_threshold;
-}
-
-int LocationServiceSettingsObjectWrapper::timeThreshold() const
-{
- return prefs.time_threshold;
-}
-
-void LocationServiceSettingsObjectWrapper::setDistanceThreshold(int value)
-{
- if (value == prefs.distance_threshold)
- return;
- QSettings s;
- s.beginGroup(group);
- s.setValue("distance_threshold", value);
- prefs.distance_threshold = value;
- emit distanceThresholdChanged(value);
-}
-
-void LocationServiceSettingsObjectWrapper::setTimeThreshold(int value)
-{
- if (value == prefs.time_threshold)
- return;
-
- QSettings s;
- s.beginGroup(group);
- s.setValue("time_threshold", value);
- prefs.time_threshold = value;
- emit timeThresholdChanged(value);
-}
-
SettingsObjectWrapper::SettingsObjectWrapper(QObject* parent):
QObject(parent),
techDetails(new qPrefTechnicalDetails(this)),
@@ -584,7 +546,7 @@ QObject(parent),
display_settings(new qPrefDisplay(this)),
language_settings(new LanguageSettingsObjectWrapper(this)),
animation_settings(new qPrefAnimations(this)),
- location_settings(new LocationServiceSettingsObjectWrapper(this)),
+ location_settings(new qPrefLocationService(this)),
update_manager_settings(new qPrefUpdateManager(this)),
dive_computer_settings(new qPrefDiveComputer(this))
{
@@ -633,10 +595,7 @@ void SettingsObjectWrapper::load()
s.endGroup();
// GPS service time and distance thresholds
- s.beginGroup("LocationService");
- GET_INT("time_threshold", time_threshold);
- GET_INT("distance_threshold", distance_threshold);
- s.endGroup();
+ qPrefLocationService::instance()->load();
qPrefDivePlanner::instance()->load();
qPrefDiveComputer::instance()->load();