From 8ef9f7e187295513ff94a2f4d47dee794a63fd20 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Fri, 5 Apr 2024 12:55:12 +0300 Subject: [PATCH] UI: IniUser: Refactor *HotKeyValue() --- src/ui/user/iniuser.cpp | 10 +++++----- src/ui/user/iniuser.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ui/user/iniuser.cpp b/src/ui/user/iniuser.cpp index e4429d69..95c819e3 100644 --- a/src/ui/user/iniuser.cpp +++ b/src/ui/user/iniuser.cpp @@ -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() diff --git a/src/ui/user/iniuser.h b/src/ui/user/iniuser.h index 2fe848e8..642835f5 100644 --- a/src/ui/user/iniuser.h +++ b/src/ui/user/iniuser.h @@ -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); }