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/utils/CacheUtils.cpp | |
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/utils/CacheUtils.cpp')
-rw-r--r-- | src/core/utils/CacheUtils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/utils/CacheUtils.cpp b/src/core/utils/CacheUtils.cpp index 32c7ac66..575634ae 100644 --- a/src/core/utils/CacheUtils.cpp +++ b/src/core/utils/CacheUtils.cpp @@ -32,18 +32,18 @@ namespace GpgFrontend { -void SetTempCacheValue(const std::string& key, const std::string& value) { - nlohmann::json cache_json = value; +void SetTempCacheValue(const QString& key, const QString& value) { + nlohmann::json cache_json = value.toStdString(); CacheManager::GetInstance().SaveCache(key, cache_json); } -auto GetTempCacheValue(const std::string& key) -> std::string { +auto GetTempCacheValue(const QString& key) -> QString { nlohmann::json cache_json = ""; cache_json = CacheManager::GetInstance().LoadCache(key, cache_json); - return cache_json.template get<std::string>(); + return QString::fromStdString(cache_json.template get<std::string>()); } -void ResetTempCacheValue(const std::string& key) { +void ResetTempCacheValue(const QString& key) { CacheManager::GetInstance().ResetCache(key); } |