From 50efbe1fcc7d0ebf5dd814a36602f88ec01d2b3a Mon Sep 17 00:00:00 2001 From: Saturneric Date: Tue, 14 Dec 2021 19:28:53 +0800 Subject: Modified Core to Optimization & Fixed Problem 1. GpgKey copy ability 2. GpgXXResult type to shared_ptr 3. KeyList Optimization 4. Fixed Loading Dialog Problem --- src/gpg/function/GpgKeyGetter.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gpg/function/GpgKeyGetter.cpp') diff --git a/src/gpg/function/GpgKeyGetter.cpp b/src/gpg/function/GpgKeyGetter.cpp index be27d69e..26973eda 100644 --- a/src/gpg/function/GpgKeyGetter.cpp +++ b/src/gpg/function/GpgKeyGetter.cpp @@ -67,9 +67,24 @@ GpgFrontend::KeyLinkListPtr GpgFrontend::GpgKeyGetter::FetchKey() { return keys_list; } + GpgFrontend::KeyListPtr GpgFrontend::GpgKeyGetter::GetKeys( const KeyIdArgsListPtr& ids) { auto keys = std::make_unique(); for (const auto& id : *ids) keys->push_back(GetKey(id)); return keys; } + +GpgFrontend::KeyLinkListPtr GpgFrontend::GpgKeyGetter::GetKeysCopy( + const GpgFrontend::KeyLinkListPtr& keys) { + auto keys_copy = std::make_unique(); + for (const auto& key : *keys) keys_copy->push_back(key.copy()); + return keys_copy; +} + +GpgFrontend::KeyListPtr GpgFrontend::GpgKeyGetter::GetKeysCopy( + const GpgFrontend::KeyListPtr& keys) { + auto keys_copy = std::make_unique(); + for (const auto& key : *keys) keys_copy->push_back(key.copy()); + return keys_copy; +} -- cgit v1.2.3 From 51259403d70cb69c2fbd2b38794867f0b60bcf35 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Thu, 16 Dec 2021 02:29:46 +0800 Subject: Added & Improved & Fixed. Fixed Bugs in core. Improved Send Mail & Keyserver Settings. Added Pubkey Sync for key list. Added Refresh for key list. Improved Send Mail and others. Known Bugs Fixed. --- src/gpg/function/GpgKeyGetter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gpg/function/GpgKeyGetter.cpp') diff --git a/src/gpg/function/GpgKeyGetter.cpp b/src/gpg/function/GpgKeyGetter.cpp index 26973eda..664aff56 100644 --- a/src/gpg/function/GpgKeyGetter.cpp +++ b/src/gpg/function/GpgKeyGetter.cpp @@ -29,7 +29,7 @@ #include "GpgConstants.h" GpgFrontend::GpgKey GpgFrontend::GpgKeyGetter::GetKey(const std::string& fpr) { - gpgme_key_t _p_key; + gpgme_key_t _p_key = nullptr; gpgme_get_key(ctx, fpr.c_str(), &_p_key, 1); if (_p_key == nullptr) { DLOG(WARNING) << "GpgKeyGetter GetKey Private _p_key Null fpr" << fpr; @@ -41,7 +41,7 @@ GpgFrontend::GpgKey GpgFrontend::GpgKeyGetter::GetKey(const std::string& fpr) { GpgFrontend::GpgKey GpgFrontend::GpgKeyGetter::GetPubkey( const std::string& fpr) { - gpgme_key_t _p_key; + gpgme_key_t _p_key = nullptr; gpgme_get_key(ctx, fpr.c_str(), &_p_key, 0); if (_p_key == nullptr) DLOG(WARNING) << "GpgKeyGetter GetKey _p_key Null" << fpr; -- cgit v1.2.3