qPref: use helper function to ensure key/name grouping

We had a couple of instances of names being incorrectly merged with their
group, this should handle that better. It's a bit of a big hammer to use, but
it seems to work (and it makes it easy to then git grep for cases that don't
use the new helper function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-09-07 09:06:00 -07:00
parent db57a633d5
commit 2ecbea3d24
15 changed files with 157 additions and 149 deletions

View file

@ -32,9 +32,9 @@ void qPrefGeocoding::set_first_taxonomy_category(taxonomy_category value)
void qPrefGeocoding::disk_first_taxonomy_category(bool doSync)
{
if (doSync)
qPrefPrivate::propSetValue(group + "/cat0", prefs.geocoding.category[0], default_prefs.geocoding.category[0]);
qPrefPrivate::propSetValue(keyFromGroupAndName(group, "cat0"), prefs.geocoding.category[0], default_prefs.geocoding.category[0]);
else
prefs.geocoding.category[0] = (enum taxonomy_category)qPrefPrivate::propValue(group + "/cat0", default_prefs.geocoding.category[0]).toInt();
prefs.geocoding.category[0] = (enum taxonomy_category)qPrefPrivate::propValue(keyFromGroupAndName(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::propSetValue(group + "/cat1", prefs.geocoding.category[1], default_prefs.geocoding.category[1]);
qPrefPrivate::propSetValue(keyFromGroupAndName(group, "cat1"), prefs.geocoding.category[1], default_prefs.geocoding.category[1]);
else
prefs.geocoding.category[1] = (enum taxonomy_category)qPrefPrivate::propValue(group + "/cat1", default_prefs.geocoding.category[1]).toInt();
prefs.geocoding.category[1] = (enum taxonomy_category)qPrefPrivate::propValue(keyFromGroupAndName(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::propSetValue(group + "/cat2", prefs.geocoding.category[2], default_prefs.geocoding.category[2]);
qPrefPrivate::propSetValue(keyFromGroupAndName(group, "cat2"), prefs.geocoding.category[2], default_prefs.geocoding.category[2]);
else
prefs.geocoding.category[2] = (enum taxonomy_category)qPrefPrivate::propValue(group + "/cat2", default_prefs.geocoding.category[2]).toInt();
prefs.geocoding.category[2] = (enum taxonomy_category)qPrefPrivate::propValue(keyFromGroupAndName(group, "cat2"), default_prefs.geocoding.category[2]).toInt();
}