diff options
author | jan Iversen <jani@apache.org> | 2018-08-15 13:26:09 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-25 11:49:47 -0700 |
commit | 69f21d9aedcea8713cf5af6463ebacba5832162e (patch) | |
tree | 7a345586bd1a4caa311e99679b766681e03aeb41 /core/settings/qPrefGeocoding.cpp | |
parent | c3a54826a2ddb17ac00ec4fdbbd18eea8a0ecbe1 (diff) | |
download | subsurface-69f21d9aedcea8713cf5af6463ebacba5832162e.tar.gz |
core: make methods in qPrefPrivate static
Small cleanup, using static methods is simpler and faster
Added propSetValue and propValue instead of exposing setting
variable.
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/settings/qPrefGeocoding.cpp')
-rw-r--r-- | core/settings/qPrefGeocoding.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/settings/qPrefGeocoding.cpp b/core/settings/qPrefGeocoding.cpp index 7f272b572..7bb043e0f 100644 --- a/core/settings/qPrefGeocoding.cpp +++ b/core/settings/qPrefGeocoding.cpp @@ -32,9 +32,9 @@ void qPrefGeocoding::set_first_taxonomy_category(taxonomy_category value) void qPrefGeocoding::disk_first_taxonomy_category(bool doSync) { if (doSync) - qPrefPrivate::instance()->setting.setValue(group + "/cat0", prefs.geocoding.category[0]); + qPrefPrivate::propSetValue(group + "/cat0", prefs.geocoding.category[0]); else - prefs.geocoding.category[0] = (enum taxonomy_category)qPrefPrivate::instance()->setting.value(group + "/cat0", default_prefs.geocoding.category[0]).toInt(); + prefs.geocoding.category[0] = (enum taxonomy_category)qPrefPrivate::propValue(group + "/cat0", default_prefs.geocoding.category[0]).toInt(); } @@ -49,9 +49,9 @@ void qPrefGeocoding::set_second_taxonomy_category(taxonomy_category value) void qPrefGeocoding::disk_second_taxonomy_category(bool doSync) { if (doSync) - qPrefPrivate::instance()->setting.setValue(group + "/cat1", prefs.geocoding.category[1]); + qPrefPrivate::propSetValue(group + "/cat1", prefs.geocoding.category[1]); else - prefs.geocoding.category[1] = (enum taxonomy_category)qPrefPrivate::instance()->setting.value(group + "/cat1", default_prefs.geocoding.category[1]).toInt(); + prefs.geocoding.category[1] = (enum taxonomy_category)qPrefPrivate::propValue(group + "/cat1", default_prefs.geocoding.category[1]).toInt(); } @@ -66,7 +66,7 @@ void qPrefGeocoding::set_third_taxonomy_category(taxonomy_category value) void qPrefGeocoding::disk_third_taxonomy_category(bool doSync) { if (doSync) - qPrefPrivate::instance()->setting.setValue(group + "/cat2", prefs.geocoding.category[2]); + qPrefPrivate::propSetValue(group + "/cat2", prefs.geocoding.category[2]); else - prefs.geocoding.category[2] = (enum taxonomy_category)qPrefPrivate::instance()->setting.value(group + "/cat2", default_prefs.geocoding.category[2]).toInt(); + prefs.geocoding.category[2] = (enum taxonomy_category)qPrefPrivate::propValue(group + "/cat2", default_prefs.geocoding.category[2]).toInt(); } |