diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-09-07 09:06:00 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-07 14:37:18 -0700 |
commit | 2ecbea3d24529b9776acb620c82af04a076b817f (patch) | |
tree | 0b0fc4eec864ff79db095d775341085cb1315895 /core/settings/qPrefPrivate.cpp | |
parent | db57a633d587444a7196c8d4274b8f327e77ceba (diff) | |
download | subsurface-2ecbea3d24529b9776acb620c82af04a076b817f.tar.gz |
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>
Diffstat (limited to 'core/settings/qPrefPrivate.cpp')
-rw-r--r-- | core/settings/qPrefPrivate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/settings/qPrefPrivate.cpp b/core/settings/qPrefPrivate.cpp index 6e835b92f..8cbbe932e 100644 --- a/core/settings/qPrefPrivate.cpp +++ b/core/settings/qPrefPrivate.cpp @@ -9,6 +9,12 @@ void qPrefPrivate::copy_txt(const char **name, const QString &string) *name = copy_qstring(string); } +QString keyFromGroupAndName(QString group, QString name) +{ + QString slash = (group.endsWith('/') || name.startsWith('/')) ? "" : "/"; + return group + slash + name; +} + void qPrefPrivate::propSetValue(const QString &key, const QVariant &value, const QVariant &defaultValue) { // REMARK: making s static (which would be logical) does NOT work |