aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/common/CoreCommonUtil.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2023-02-07 07:16:45 +0000
committerSaturneric <[email protected]>2023-02-07 07:16:45 +0000
commita49c6605244d656d4a4b72e95fbbcbe83372d363 (patch)
treeba28d451a0c78041f36e0e8be7ca30114ddce4ef /src/core/common/CoreCommonUtil.cpp
parentfeat: add a custom pinentry hook for sandbox mode in macOS (diff)
downloadGpgFrontend-a49c6605244d656d4a4b72e95fbbcbe83372d363.tar.gz
GpgFrontend-a49c6605244d656d4a4b72e95fbbcbe83372d363.zip
feat: use custom password dialog now
Diffstat (limited to 'src/core/common/CoreCommonUtil.cpp')
-rw-r--r--src/core/common/CoreCommonUtil.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/common/CoreCommonUtil.cpp b/src/core/common/CoreCommonUtil.cpp
index a19994a6..54400e24 100644
--- a/src/core/common/CoreCommonUtil.cpp
+++ b/src/core/common/CoreCommonUtil.cpp
@@ -26,6 +26,8 @@
#include "CoreCommonUtil.h"
+#include <string>
+
namespace GpgFrontend {
std::unique_ptr<CoreCommonUtil> CoreCommonUtil::instance_ = nullptr; ///<
@@ -37,4 +39,21 @@ CoreCommonUtil *CoreCommonUtil::GetInstance() {
}
return instance_.get();
}
+
+void CoreCommonUtil::SetTempCacheValue(const std::string key,
+ const std::string value) {
+ temp_cache_[key] = value;
+}
+
+std::string CoreCommonUtil::GetTempCacheValue(const std::string key) {
+ std::string temp_cache_value;
+ std::swap(temp_cache_value, temp_cache_[key]);
+ return temp_cache_value;
+}
+
+void CoreCommonUtil::ResetTempCacheValue(const std::string key) {
+ std::string temp_cache_value;
+ std::swap(temp_cache_value, temp_cache_[key]);
+}
+
} // namespace GpgFrontend