aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/result_analyse/DecryptResultAnalyse.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-06-09 19:02:41 +0000
committerSaturneric <[email protected]>2021-06-09 19:02:41 +0000
commit7d000da3e8c8a65b43174b5be2edcd4c1bd6c27e (patch)
tree698f2ace3c49453768bf3c85e97069d65700e950 /src/gpg/result_analyse/DecryptResultAnalyse.cpp
parentAdjust the output of analysis results. (diff)
downloadGpgFrontend-7d000da3e8c8a65b43174b5be2edcd4c1bd6c27e.tar.gz
GpgFrontend-7d000da3e8c8a65b43174b5be2edcd4c1bd6c27e.zip
Do not clear the text when the decryption operation fails.
Add decrypt and verify operation. Change the icon further. Fix the function of importing from the key server. Signed-off-by: Saturneric <[email protected]>
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;
}