From ff710ebd2c702cbca6d4d6d21f19f69c24a62042 Mon Sep 17 00:00:00 2001 From: Eugene Shalygin Date: Wed, 5 Jul 2017 13:41:08 +0200 Subject: [PATCH] fixup! Implement enum support in CachedSettingValue --- src/base/settingvalue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/settingvalue.h b/src/base/settingvalue.h index 2f86bcc43..ec0ba71a1 100644 --- a/src/base/settingvalue.h +++ b/src/base/settingvalue.h @@ -87,7 +87,7 @@ private: SettingsStorage::instance()->storeValue(m_keyName, value); } - // load/save pair for enum + // load/save pair for an enum // saves literal value of the enum constant, obtained from QMetaEnum template ::value, int>::type = 0> U loadValue(const U &defaultValue) @@ -97,7 +97,7 @@ private: bool ok = false; const U res = static_cast(QMetaEnum::fromType().keyToValue( - SettingsStorage::instance()->loadValue(m_keyName, QString()).toString().toLatin1().constData(), &ok)); + SettingsStorage::instance()->loadValue(m_keyName).toString().toLatin1().constData(), &ok)); return ok ? res : defaultValue; }