diff options
author | Saturneric <[email protected]> | 2021-06-09 19:02:41 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-06-09 19:02:41 +0000 |
commit | 7d000da3e8c8a65b43174b5be2edcd4c1bd6c27e (patch) | |
tree | 698f2ace3c49453768bf3c85e97069d65700e950 /src/gpg/result_analyse/SignResultAnalyse.cpp | |
parent | Adjust the output of analysis results. (diff) | |
download | GpgFrontend-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/SignResultAnalyse.cpp')
-rw-r--r-- | src/gpg/result_analyse/SignResultAnalyse.cpp | 67 |
1 files changed, 35 insertions, 32 deletions
diff --git a/src/gpg/result_analyse/SignResultAnalyse.cpp b/src/gpg/result_analyse/SignResultAnalyse.cpp index eda95ff1..15d6ddf5 100644 --- a/src/gpg/result_analyse/SignResultAnalyse.cpp +++ b/src/gpg/result_analyse/SignResultAnalyse.cpp @@ -26,53 +26,56 @@ SignResultAnalyse::SignResultAnalyse(gpgme_error_t error, gpgme_sign_result_t result) { - if(result == nullptr) { - return; - } - stream << "# Sign Report: " << endl << "-----" << endl; stream << "Status: " << gpgme_strerror(error) << endl << endl; - auto new_sign = result->signatures; + if(gpg_err_code(error) != GPG_ERR_NO_ERROR) { + setStatus(-1); + } - while(new_sign != nullptr) { - stream << "> A New Signature: " << endl; + if(result != nullptr) { - stream << "Sign mode: "; - if(new_sign->type == GPGME_SIG_MODE_NORMAL) - stream << "Normal"; - else if(new_sign->type == GPGME_SIG_MODE_CLEAR) - stream << "Clear"; - else if(new_sign->type == GPGME_SIG_MODE_DETACH) - stream << "Detach"; + auto new_sign = result->signatures; - stream << endl; + while (new_sign != nullptr) { + stream << "> A New Signature: " << endl; - stream << "Public key algo: " << gpgme_pubkey_algo_name(new_sign->pubkey_algo) << endl; - stream << "Hash algo: " << gpgme_hash_algo_name(new_sign->hash_algo) << endl; - stream << "Date of signature: " << QDateTime::fromTime_t(new_sign->timestamp).toString() << endl; + stream << "Sign mode: "; + if (new_sign->type == GPGME_SIG_MODE_NORMAL) + stream << "Normal"; + else if (new_sign->type == GPGME_SIG_MODE_CLEAR) + stream << "Clear"; + else if (new_sign->type == GPGME_SIG_MODE_DETACH) + stream << "Detach"; - stream << endl; + stream << endl; - new_sign = new_sign->next; - } + stream << "Public key algo: " << gpgme_pubkey_algo_name(new_sign->pubkey_algo) << endl; + stream << "Hash algo: " << gpgme_hash_algo_name(new_sign->hash_algo) << endl; + stream << "Date of signature: " << QDateTime::fromTime_t(new_sign->timestamp).toString() << endl; + + stream << endl; + + new_sign = new_sign->next; + } + + auto invalid_signer = result->invalid_signers; - auto invalid_signer = result->invalid_signers; + if (invalid_signer != nullptr) + stream << "Invalid Signers: " << endl; - if(invalid_signer!= nullptr) - stream << "Invalid Signers: " << endl; + while (invalid_signer != nullptr) { + setStatus(0); + stream << "Fingerprint: " << invalid_signer->fpr << endl; + stream << "Reason: " << gpgme_strerror(invalid_signer->reason) << endl; + stream << endl; - while(invalid_signer != nullptr) { - setStatus(0); - stream << "Fingerprint: " << invalid_signer->fpr << endl; - stream << "Reason: " << gpgme_strerror(invalid_signer->reason) << endl; - stream << endl; + invalid_signer = invalid_signer->next; + } - invalid_signer = invalid_signer->next; } - stream << "-----" << endl; - stream << endl; + stream << "-----" << endl << endl; } |