diff options
author | saturneric <[email protected]> | 2024-01-12 06:02:37 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-12 06:02:37 +0000 |
commit | bf538056b24a68b8fd235b1c50991ee8eb46a776 (patch) | |
tree | e1bab54095b80df62b321fb5bd69453f9f951b05 /src/core/function/GlobalSettingStation.h | |
parent | feat: improve api and ui of keys import and export (diff) | |
download | GpgFrontend-bf538056b24a68b8fd235b1c50991ee8eb46a776.tar.gz GpgFrontend-bf538056b24a68b8fd235b1c50991ee8eb46a776.zip |
refactor: use QString instead of std::string and improve threading system
Diffstat (limited to 'src/core/function/GlobalSettingStation.h')
-rw-r--r-- | src/core/function/GlobalSettingStation.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/function/GlobalSettingStation.h b/src/core/function/GlobalSettingStation.h index 06f37264..5611161b 100644 --- a/src/core/function/GlobalSettingStation.h +++ b/src/core/function/GlobalSettingStation.h @@ -122,16 +122,16 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation /** * @brief Get the Log Files Size object * - * @return std::string + * @return QString */ - [[nodiscard]] auto GetLogFilesSize() const -> std::string; + [[nodiscard]] auto GetLogFilesSize() const -> QString; /** * @brief Get the Data Objects Files Size object * - * @return std::string + * @return QString */ - [[nodiscard]] auto GetDataObjectsFilesSize() const -> std::string; + [[nodiscard]] auto GetDataObjectsFilesSize() const -> QString; /** * @brief clear all log files @@ -158,10 +158,10 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation * @return The setting value. */ template <typename T> - auto LookupSettings(std::string path, T default_value) noexcept -> T { + auto LookupSettings(QString path, T default_value) noexcept -> T { T value = default_value; try { - value = static_cast<T>(GetMainSettings().lookup(path)); + value = static_cast<T>(GetMainSettings().lookup(path.toStdString())); } catch (...) { GF_CORE_LOG_WARN("setting not found: {}", path); } @@ -175,12 +175,12 @@ class GPGFRONTEND_CORE_EXPORT GlobalSettingStation * @return The setting value. */ template <typename T> - auto SaveSettings(std::string path, libconfig::Setting::Type type, + auto SaveSettings(QString path, libconfig::Setting::Type type, T value) noexcept -> T { try { - if (!GetMainSettings().exists(path)) { + if (!GetMainSettings().exists(path.toStdString())) { // TODO - GetMainSettings().add(path, type); + GetMainSettings().add(path.toStdString(), type); } } catch (...) { GF_CORE_LOG_WARN("setting not found: {}", path); |