UI: IniUser: Refactor *HotKeyValue()

This commit is contained in:
Nodir Temirkhodjaev 2024-04-05 12:55:12 +03:00
parent c136cb1e9a
commit 8ef9f7e187
2 changed files with 7 additions and 7 deletions

View File

@ -39,16 +39,16 @@ const char *const defaultValue(const char *key)
IniUser::IniUser(Settings *settings) : MapSettings(settings) { }
QString IniUser::hotKeyValue(const QString &key) const
QString IniUser::hotKeyValue(const char *key) const
{
const auto &defaultValue = HotKey::defaultValue(key.toLatin1());
const auto &defaultValue = HotKey::defaultValue(key);
return valueText("hotKey/" + key, defaultValue);
return valueText("hotKey/" + QLatin1String(key), defaultValue);
}
void IniUser::setHotKeyValue(const QString &key, const QString &v)
void IniUser::setHotKeyValue(const char *key, const QString &v)
{
setValue("hotKey/" + key, v);
setValue("hotKey/" + QLatin1String(key), v);
}
void IniUser::saveDefaultIni()

View File

@ -58,8 +58,8 @@ public:
bool hotKeyGlobal() const { return valueBool("hotKey/global", true); }
void setHotKeyGlobal(bool v) { setValue("hotKey/global", v, true); }
QString hotKeyValue(const QString &key) const;
void setHotKeyValue(const QString &key, const QString &v);
QString hotKeyValue(const char *key) const;
void setHotKeyValue(const char *key, const QString &v);
bool splashWindowVisible() const { return valueBool("splashWindow/visible", true); }
void setSplashWindowVisible(bool on) { setValue("splashWindow/visible", on, true); }