aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/result_analyse/GpgDecryptResultAnalyse.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-12-25 12:51:01 +0000
committersaturneric <[email protected]>2023-12-25 12:51:01 +0000
commit5260d7a5634279408b3eb36a5f26fe71fb6f9e69 (patch)
tree670e0878a41e8c6b1651fedbd224bfbea94e0849 /src/core/function/result_analyse/GpgDecryptResultAnalyse.cpp
parentfix: use the new async encrypt symmetric api at gui app (diff)
downloadGpgFrontend-5260d7a5634279408b3eb36a5f26fe71fb6f9e69.tar.gz
GpgFrontend-5260d7a5634279408b3eb36a5f26fe71fb6f9e69.zip
feat: upgrade basical operations fully to async style and update test cases
Diffstat (limited to 'src/core/function/result_analyse/GpgDecryptResultAnalyse.cpp')
-rw-r--r--src/core/function/result_analyse/GpgDecryptResultAnalyse.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/core/function/result_analyse/GpgDecryptResultAnalyse.cpp b/src/core/function/result_analyse/GpgDecryptResultAnalyse.cpp
index 9273c850..a97e9871 100644
--- a/src/core/function/result_analyse/GpgDecryptResultAnalyse.cpp
+++ b/src/core/function/result_analyse/GpgDecryptResultAnalyse.cpp
@@ -32,10 +32,12 @@
#include "core/function/gpg/GpgKeyGetter.h"
GpgFrontend::GpgDecryptResultAnalyse::GpgDecryptResultAnalyse(
- GpgError m_error, GpgDecrResult m_result)
- : error_(m_error), result_(std::move(m_result)) {}
+ GpgError m_error, GpgDecryptResult m_result)
+ : error_(m_error), result_(m_result) {}
void GpgFrontend::GpgDecryptResultAnalyse::doAnalyse() {
+ auto *result = result_.GetRaw();
+
stream_ << "[#] " << _("Decrypt Operation");
if (gpgme_err_code(error_) == GPG_ERR_NO_ERROR) {
@@ -44,24 +46,24 @@ void GpgFrontend::GpgDecryptResultAnalyse::doAnalyse() {
stream_ << "[" << _("Failed") << "] " << gpgme_strerror(error_)
<< std::endl;
setStatus(-1);
- if (result_ != nullptr && result_->unsupported_algorithm != nullptr) {
+ if (result != nullptr && result->unsupported_algorithm != nullptr) {
stream_ << "------------>" << std::endl;
- stream_ << _("Unsupported Algo") << ": " << result_->unsupported_algorithm
+ stream_ << _("Unsupported Algo") << ": " << result->unsupported_algorithm
<< std::endl;
}
}
- if (result_ != nullptr && result_->recipients != nullptr) {
+ if (result != nullptr && result->recipients != nullptr) {
stream_ << "------------>" << std::endl;
- if (result_->file_name != nullptr) {
- stream_ << _("File Name") << ": " << result_->file_name << std::endl;
+ if (result->file_name != nullptr) {
+ stream_ << _("File Name") << ": " << result->file_name << std::endl;
stream_ << std::endl;
}
- if (result_->is_mime) {
+ if (result->is_mime) {
stream_ << _("MIME") << ": " << _("true") << std::endl;
}
- auto *recipient = result_->recipients;
+ auto *recipient = result->recipients;
if (recipient != nullptr) stream_ << _("Recipient(s)") << ": " << std::endl;
while (recipient != nullptr) {
print_recipient(stream_, recipient);