aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/GlobalSettingStation.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-12 06:02:37 +0000
committersaturneric <[email protected]>2024-01-12 06:02:37 +0000
commitbf538056b24a68b8fd235b1c50991ee8eb46a776 (patch)
treee1bab54095b80df62b321fb5bd69453f9f951b05 /src/core/function/GlobalSettingStation.h
parentfeat: improve api and ui of keys import and export (diff)
downloadGpgFrontend-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.h18
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);