aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/result_analyse/DecryptResultAnalyse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpg/result_analyse/DecryptResultAnalyse.cpp')
-rw-r--r--src/gpg/result_analyse/DecryptResultAnalyse.cpp37
1 files changed, 17 insertions, 20 deletions
diff --git a/src/gpg/result_analyse/DecryptResultAnalyse.cpp b/src/gpg/result_analyse/DecryptResultAnalyse.cpp
index 79c6bc51..d0f3ae99 100644
--- a/src/gpg/result_analyse/DecryptResultAnalyse.cpp
+++ b/src/gpg/result_analyse/DecryptResultAnalyse.cpp
@@ -7,36 +7,33 @@
DecryptResultAnalyse::DecryptResultAnalyse(GpgME::GpgContext *ctx, gpgme_error_t error, gpgme_decrypt_result_t result)
: mCtx(ctx) {
- if(result == nullptr) {
- return;
- }
-
stream << "Decrypt Report: " << endl << "-----" << endl;
if (gpgme_err_code(error) == GPG_ERR_NO_ERROR) {
stream << "Status: Success" << endl;
} else {
- stream << "Status" << gpgme_strerror(error) << endl;
- if (result->unsupported_algorithm != nullptr) {
+ setStatus(-1);
+ stream << "Status: " << gpgme_strerror(error) << endl;
+
+ if (result != nullptr && result->unsupported_algorithm != nullptr)
stream << "Unsupported algo: " << result->unsupported_algorithm << endl;
- }
}
- if (result->file_name != nullptr) {
- stream << "File name: " << result->file_name << endl;
+ if(result != nullptr) {
+ if (result->file_name != nullptr)
+ stream << "File name: " << result->file_name << endl;
+ stream << endl;
+
+ auto reci = result->recipients;
+ if (reci != nullptr)
+ stream << "Recipient(s): " << endl;
+ while (reci != nullptr) {
+ printReci(stream, reci);
+ reci = reci->next;
+ }
}
- stream << endl;
-
- auto reci = result->recipients;
-
- if (reci != nullptr) {
- stream << "Recipient(s): " << endl;
- }
- while (reci != nullptr) {
- printReci(stream, reci);
- reci = reci->next;
- }
+ stream << "-----" << endl << endl;
}