aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/model/GpgKey.h
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/model/GpgKey.h
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 '')
-rw-r--r--src/gpg/model/GpgKey.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gpg/model/GpgKey.h b/src/gpg/model/GpgKey.h
index 3bebcd41..5ddfa94b 100644
--- a/src/gpg/model/GpgKey.h
+++ b/src/gpg/model/GpgKey.h
@@ -144,9 +144,16 @@ class GpgKey {
explicit operator gpgme_key_t() const { return _key_ref.get(); }
+ [[nodiscard]] GpgKey copy() const {
+ gpgme_key_ref(_key_ref.get());
+ auto* _new_key_ref = _key_ref.get();
+ return GpgKey(std::move(_new_key_ref));
+ }
+
private:
struct _key_ref_deletor {
void operator()(gpgme_key_t _key) {
+ DLOG(INFO) << "Called" << _key;
if (_key != nullptr) gpgme_key_unref(_key);
}
};