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/BasicOperator.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/gpg/function/BasicOperator.cpp') diff --git a/src/gpg/function/BasicOperator.cpp b/src/gpg/function/BasicOperator.cpp index 5f6ffb85..f91282c4 100644 --- a/src/gpg/function/BasicOperator.cpp +++ b/src/gpg/function/BasicOperator.cpp @@ -48,7 +48,7 @@ GpgFrontend::GpgError GpgFrontend::BasicOperator::Encrypt( auto temp_data_out = data_out.Read2Buffer(); std::swap(temp_data_out, out_buffer); - auto temp_result = GpgEncrResult(gpgme_op_encrypt_result(ctx)); + auto temp_result = _new_result(gpgme_op_encrypt_result(ctx)); std::swap(result, temp_result); return err; @@ -65,7 +65,7 @@ GpgFrontend::GpgError GpgFrontend::BasicOperator::Decrypt( auto temp_data_out = data_out.Read2Buffer(); std::swap(temp_data_out, out_buffer); - auto temp_result = GpgDecrResult(gpgme_op_decrypt_result(ctx)); + auto temp_result = _new_result(gpgme_op_decrypt_result(ctx)); std::swap(result, temp_result); return err; @@ -86,7 +86,7 @@ GpgFrontend::GpgError GpgFrontend::BasicOperator::Verify( } else err = check_gpg_error(gpgme_op_verify(ctx, data_in, nullptr, data_out)); - auto temp_result = GpgVerifyResult(gpgme_op_verify_result(ctx)); + auto temp_result = _new_result(gpgme_op_verify_result(ctx)); std::swap(result, temp_result); return err; @@ -122,7 +122,7 @@ GpgFrontend::GpgError GpgFrontend::BasicOperator::Sign(KeyListPtr keys, auto temp_data_out = data_out.Read2Buffer(); std::swap(temp_data_out, out_buffer); - auto temp_result = GpgSignResult(gpgme_op_sign_result(ctx)); + auto temp_result = _new_result(gpgme_op_sign_result(ctx)); std::swap(result, temp_result); @@ -141,10 +141,10 @@ gpgme_error_t GpgFrontend::BasicOperator::DecryptVerify( auto temp_data_out = data_out.Read2Buffer(); std::swap(temp_data_out, out_buffer); - auto temp_decr_result = GpgDecrResult(gpgme_op_decrypt_result(ctx)); + auto temp_decr_result = _new_result(gpgme_op_decrypt_result(ctx)); std::swap(decrypt_result, temp_decr_result); - auto temp_verify_result = GpgVerifyResult(gpgme_op_verify_result(ctx)); + auto temp_verify_result = _new_result(gpgme_op_verify_result(ctx)); std::swap(verify_result, temp_verify_result); return err; @@ -176,9 +176,9 @@ gpgme_error_t GpgFrontend::BasicOperator::EncryptSign( auto temp_data_out = data_out.Read2Buffer(); std::swap(temp_data_out, out_buffer); - auto temp_encr_result = GpgEncrResult(gpgme_op_encrypt_result(ctx)); + auto temp_encr_result = _new_result(gpgme_op_encrypt_result(ctx)); swap(encr_result, temp_encr_result); - auto temp_sign_result = GpgSignResult(gpgme_op_sign_result(ctx)); + auto temp_sign_result = _new_result(gpgme_op_sign_result(ctx)); swap(sign_result, temp_sign_result); return err; -- 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/BasicOperator.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gpg/function/BasicOperator.cpp') diff --git a/src/gpg/function/BasicOperator.cpp b/src/gpg/function/BasicOperator.cpp index f91282c4..ee59ff37 100644 --- a/src/gpg/function/BasicOperator.cpp +++ b/src/gpg/function/BasicOperator.cpp @@ -217,8 +217,11 @@ gpg_error_t GpgFrontend::BasicOperator::EncryptSymmetric( auto temp_data_out = data_out.Read2Buffer(); std::swap(temp_data_out, out_buffer); - auto temp_result = GpgEncrResult(gpgme_op_encrypt_result(ctx)); - std::swap(result, temp_result); + // TODO(Saturneric): maybe a bug of gpgme + if (gpgme_err_code(err) == GPG_ERR_NO_ERROR) { + auto temp_result = GpgEncrResult(gpgme_op_encrypt_result(ctx)); + std::swap(result, temp_result); + } return err; } -- cgit v1.2.3 From 1a51a285410b673bc020b5b9e4430a824a4addce Mon Sep 17 00:00:00 2001 From: Saturneric Date: Fri, 17 Dec 2021 04:05:31 +0800 Subject: Fixed bugs & Improve Speed. --- src/gpg/function/BasicOperator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gpg/function/BasicOperator.cpp') diff --git a/src/gpg/function/BasicOperator.cpp b/src/gpg/function/BasicOperator.cpp index ee59ff37..56b7ca54 100644 --- a/src/gpg/function/BasicOperator.cpp +++ b/src/gpg/function/BasicOperator.cpp @@ -219,7 +219,7 @@ gpg_error_t GpgFrontend::BasicOperator::EncryptSymmetric( // TODO(Saturneric): maybe a bug of gpgme if (gpgme_err_code(err) == GPG_ERR_NO_ERROR) { - auto temp_result = GpgEncrResult(gpgme_op_encrypt_result(ctx)); + auto temp_result = _new_result(gpgme_op_encrypt_result(ctx)); std::swap(result, temp_result); } -- cgit v1.2.3