aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/utils/CacheUtils.cpp
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/utils/CacheUtils.cpp
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/utils/CacheUtils.cpp')
-rw-r--r--src/core/utils/CacheUtils.cpp10
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);
}