mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
c3a54826a2
commit
69f21d9aed
7 changed files with 65 additions and 74 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue