aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/GpgConstants.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-12-14 11:28:53 +0000
committerSaturneric <[email protected]>2021-12-14 11:28:53 +0000
commit50efbe1fcc7d0ebf5dd814a36602f88ec01d2b3a (patch)
treef64a58f0572b6af09323273b073e39fda78dff33 /src/gpg/GpgConstants.cpp
parentAdd Deb Build Support & Install Support For Linux. (diff)
downloadGpgFrontend-50efbe1fcc7d0ebf5dd814a36602f88ec01d2b3a.tar.gz
GpgFrontend-50efbe1fcc7d0ebf5dd814a36602f88ec01d2b3a.zip
Modified Core to Optimization & Fixed Problem
1. GpgKey copy ability 2. GpgXXResult type to shared_ptr 3. KeyList Optimization 4. Fixed Loading Dialog Problem
Diffstat (limited to 'src/gpg/GpgConstants.cpp')
-rw-r--r--src/gpg/GpgConstants.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gpg/GpgConstants.cpp b/src/gpg/GpgConstants.cpp
index 2454daa2..d38cafe3 100644
--- a/src/gpg/GpgConstants.cpp
+++ b/src/gpg/GpgConstants.cpp
@@ -190,3 +190,32 @@ int GpgFrontend::text_is_signed(GpgFrontend::BypeArrayRef text) {
else
return 0;
}
+
+GpgFrontend::GpgEncrResult GpgFrontend::_new_result(
+ gpgme_encrypt_result_t&& result) {
+ gpgme_result_ref(result);
+ return {result, _result_ref_deletor()};
+}
+
+GpgFrontend::GpgDecrResult GpgFrontend::_new_result(
+ gpgme_decrypt_result_t&& result) {
+ gpgme_result_ref(result);
+ return {result, _result_ref_deletor()};
+}
+
+GpgFrontend::GpgSignResult GpgFrontend::_new_result(
+ gpgme_sign_result_t&& result) {
+ gpgme_result_ref(result);
+ return {result, _result_ref_deletor()};
+}
+
+GpgFrontend::GpgVerifyResult GpgFrontend::_new_result(
+ gpgme_verify_result_t&& result) {
+ gpgme_result_ref(result);
+ return {result, _result_ref_deletor()};
+}
+
+void GpgFrontend::_result_ref_deletor::operator()(void* _result) {
+ DLOG(INFO) << "Called" << _result;
+ if (_result != nullptr) gpgme_result_unref(_result);
+}