From 5cd35537f360b6e114e894648068d641cbadd52c Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sun, 19 Mar 2023 12:21:57 +0300 Subject: [PATCH] UI: Settings: Fix cached values' keys --- src/ui/util/ini/settings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/util/ini/settings.cpp b/src/ui/util/ini/settings.cpp index a1481dc5..f997f08b 100644 --- a/src/ui/util/ini/settings.cpp +++ b/src/ui/util/ini/settings.cpp @@ -96,7 +96,10 @@ QVariant Settings::iniValue(const QString &key, const QVariant &defaultValue) co return QVariant(); // Try to load from cache - const auto cachedValue = cacheValue(key); + const QString group = m_ini->group(); + const QString cachedKey = group.isEmpty() ? key : group + '/' + key; + + const QVariant cachedValue = cacheValue(cachedKey); if (!cachedValue.isNull()) return cachedValue; @@ -104,7 +107,7 @@ QVariant Settings::iniValue(const QString &key, const QVariant &defaultValue) co const auto value = m_ini->value(key, defaultValue); // Save to cache - setCacheValue(key, value); + setCacheValue(cachedKey, value); return value; }