diff --git a/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp b/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp index b74e7a06..dc0d0f01 100644 --- a/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp +++ b/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp @@ -90,7 +90,6 @@ Error QGpgMEAddExistingSubkeyJob::start(const GpgME::Key &key, const GpgME::Subk Error QGpgMEAddExistingSubkeyJob::exec(const GpgME::Key &key, const GpgME::Subkey &subkey) { const result_type r = add_subkey(context(), key, subkey); - resultHook(r); return std::get<0>(r); } diff --git a/lang/qt/src/qgpgmedecryptjob.cpp b/lang/qt/src/qgpgmedecryptjob.cpp index 5b7d7ae5..6d7d4f17 100644 --- a/lang/qt/src/qgpgmedecryptjob.cpp +++ b/lang/qt/src/qgpgmedecryptjob.cpp @@ -122,13 +122,7 @@ GpgME::DecryptionResult QGpgME::QGpgMEDecryptJob::exec(const QByteArray &cipherT { const result_type r = decrypt_qba(context(), cipherText); plainText = std::get<1>(r); - resultHook(r); - return mResult; -} - -void QGpgMEDecryptJob::resultHook(const result_type &tuple) -{ - mResult = std::get<0>(tuple); + return std::get<0>(r); } #include "qgpgmedecryptjob.moc" diff --git a/lang/qt/src/qgpgmedecryptjob.h b/lang/qt/src/qgpgmedecryptjob.h index ea648667..29ac5d44 100644 --- a/lang/qt/src/qgpgmedecryptjob.h +++ b/lang/qt/src/qgpgmedecryptjob.h @@ -73,12 +73,6 @@ public: /* from DecryptJob */ GpgME::DecryptionResult exec(const QByteArray &cipherText, QByteArray &plainText) override; - - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - -private: - GpgME::DecryptionResult mResult; }; } diff --git a/lang/qt/src/qgpgmedecryptverifyjob.cpp b/lang/qt/src/qgpgmedecryptverifyjob.cpp index bc135147..8e9b501a 100644 --- a/lang/qt/src/qgpgmedecryptverifyjob.cpp +++ b/lang/qt/src/qgpgmedecryptverifyjob.cpp @@ -195,13 +195,7 @@ QGpgME::QGpgMEDecryptVerifyJob::exec(const QByteArray &cipherText, QByteArray &p { const result_type r = decrypt_verify_qba(context(), cipherText); plainText = std::get<2>(r); - resultHook(r); - return mResult; -} - -void QGpgMEDecryptVerifyJob::resultHook(const result_type &tuple) -{ - mResult = std::make_pair(std::get<0>(tuple), std::get<1>(tuple)); + return std::make_pair(std::get<0>(r), std::get<1>(r)); } GpgME::Error QGpgMEDecryptVerifyJobPrivate::startIt() diff --git a/lang/qt/src/qgpgmedecryptverifyjob.h b/lang/qt/src/qgpgmedecryptverifyjob.h index 01794319..14258ae2 100644 --- a/lang/qt/src/qgpgmedecryptverifyjob.h +++ b/lang/qt/src/qgpgmedecryptverifyjob.h @@ -78,12 +78,6 @@ public: /* from DecryptVerifyJob */ std::pair exec(const QByteArray &cipherText, QByteArray &plainText) override; - - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - -private: - std::pair mResult; }; } diff --git a/lang/qt/src/qgpgmeencryptjob.cpp b/lang/qt/src/qgpgmeencryptjob.cpp index d254d8a4..213c88c7 100644 --- a/lang/qt/src/qgpgmeencryptjob.cpp +++ b/lang/qt/src/qgpgmeencryptjob.cpp @@ -228,8 +228,7 @@ EncryptionResult QGpgMEEncryptJob::exec(const std::vector &recipients, cons { const result_type r = encrypt_qba(context(), recipients, plainText, eflags, mOutputIsBase64Encoded, inputEncoding(), fileName()); cipherText = std::get<1>(r); - resultHook(r); - return mResult; + return std::get<0>(r); } void QGpgMEEncryptJob::start(const std::vector &recipients, const std::shared_ptr &plainText, const std::shared_ptr &cipherText, bool alwaysTrust) @@ -242,11 +241,6 @@ EncryptionResult QGpgMEEncryptJob::exec(const std::vector &recipients, cons return exec(recipients, plainText, alwaysTrust ? Context::AlwaysTrust : Context::None, cipherText); } -void QGpgMEEncryptJob::resultHook(const result_type &tuple) -{ - mResult = std::get<0>(tuple); -} - GpgME::Error QGpgMEEncryptJobPrivate::startIt() { if (m_inputFilePath.isEmpty() || m_outputFilePath.isEmpty()) { diff --git a/lang/qt/src/qgpgmeencryptjob.h b/lang/qt/src/qgpgmeencryptjob.h index 07b05f8f..3b21b40b 100644 --- a/lang/qt/src/qgpgmeencryptjob.h +++ b/lang/qt/src/qgpgmeencryptjob.h @@ -97,12 +97,8 @@ public: /* from EncryptJob */ void setOutputIsBase64Encoded(bool on) override; - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - private: bool mOutputIsBase64Encoded; - GpgME::EncryptionResult mResult; }; } diff --git a/lang/qt/src/qgpgmegpgcardjob.cpp b/lang/qt/src/qgpgmegpgcardjob.cpp index ae0bf72c..2bed23c2 100644 --- a/lang/qt/src/qgpgmegpgcardjob.cpp +++ b/lang/qt/src/qgpgmegpgcardjob.cpp @@ -122,7 +122,6 @@ Error QGpgMEGpgCardJob::exec(const QStringList &cmds, QString &std_out, QString return Error(make_error(GPG_ERR_NOT_SUPPORTED)); } const result_type r = do_work(cmds, cardpath); - resultHook(r); std_out = std::get<0>(r); std_err = std::get<1>(r); exitCode = std::get<2>(r); diff --git a/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp b/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp index 6395b8d9..f9d47879 100644 --- a/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp +++ b/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp @@ -74,12 +74,7 @@ Error QGpgMEImportFromKeyserverJob::start(const std::vector &keys) GpgME::ImportResult QGpgME::QGpgMEImportFromKeyserverJob::exec(const std::vector &keys) { const result_type r = importfromkeyserver(context(), keys); - resultHook(r); - return mResult; + return std::get<0>(r); } -void QGpgME::QGpgMEImportFromKeyserverJob::resultHook(const result_type &tuple) -{ - mResult = std::get<0>(tuple); -} #include "qgpgmeimportfromkeyserverjob.moc" diff --git a/lang/qt/src/qgpgmeimportfromkeyserverjob.h b/lang/qt/src/qgpgmeimportfromkeyserverjob.h index 1dfcbc19..b67ea29c 100644 --- a/lang/qt/src/qgpgmeimportfromkeyserverjob.h +++ b/lang/qt/src/qgpgmeimportfromkeyserverjob.h @@ -69,12 +69,6 @@ public: /* from ImportFromKeyserverJob */ GpgME::ImportResult exec(const std::vector &keys) override; - - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - -private: - GpgME::ImportResult mResult; }; } diff --git a/lang/qt/src/qgpgmeimportjob.cpp b/lang/qt/src/qgpgmeimportjob.cpp index f1410700..848bcacf 100644 --- a/lang/qt/src/qgpgmeimportjob.cpp +++ b/lang/qt/src/qgpgmeimportjob.cpp @@ -156,8 +156,7 @@ Error QGpgMEImportJob::start(const QByteArray &certData) GpgME::ImportResult QGpgME::QGpgMEImportJob::exec(const QByteArray &keyData) { const result_type r = import_qba(context(), keyData, importFilter(), keyOrigin(), keyOriginUrl()); - resultHook(r); - return mResult; + return std::get<0>(r); } Error QGpgMEImportJob::startLater(const QByteArray &certData) @@ -166,8 +165,4 @@ Error QGpgMEImportJob::startLater(const QByteArray &certData) return {}; } -void QGpgME::QGpgMEImportJob::resultHook(const result_type &tuple) -{ - mResult = std::get<0>(tuple); -} #include "qgpgmeimportjob.moc" diff --git a/lang/qt/src/qgpgmeimportjob.h b/lang/qt/src/qgpgmeimportjob.h index 4c22ae92..130d29ce 100644 --- a/lang/qt/src/qgpgmeimportjob.h +++ b/lang/qt/src/qgpgmeimportjob.h @@ -73,12 +73,6 @@ public: GpgME::ImportResult exec(const QByteArray &keyData) override; GpgME::Error startLater(const QByteArray &keyData) override; - - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - -private: - GpgME::ImportResult mResult; }; } diff --git a/lang/qt/src/qgpgmekeyformailboxjob.cpp b/lang/qt/src/qgpgmekeyformailboxjob.cpp index 8a6651ba..dca22426 100644 --- a/lang/qt/src/qgpgmekeyformailboxjob.cpp +++ b/lang/qt/src/qgpgmekeyformailboxjob.cpp @@ -134,7 +134,6 @@ Error QGpgMEKeyForMailboxJob::start(const QString &mailbox, bool canEncrypt) KeyListResult QGpgMEKeyForMailboxJob::exec(const QString &mailbox, bool canEncrypt, Key &key, UserID &uid) { const result_type r = do_work(context(), mailbox, canEncrypt); - resultHook(r); key = std::get<1>(r); uid = std::get<2>(r); return std::get<0>(r); diff --git a/lang/qt/src/qgpgmekeylistjob.cpp b/lang/qt/src/qgpgmekeylistjob.cpp index e395359a..d3d13119 100644 --- a/lang/qt/src/qgpgmekeylistjob.cpp +++ b/lang/qt/src/qgpgmekeylistjob.cpp @@ -55,8 +55,8 @@ using namespace QGpgME; using namespace GpgME; QGpgMEKeyListJob::QGpgMEKeyListJob(Context *context) - : mixin_type(context), - mResult(), mSecretOnly(false) + : mixin_type(context) + , mSecretOnly(false) { lateInitialization(); } @@ -151,7 +151,6 @@ KeyListResult QGpgMEKeyListJob::exec(const QStringList &patterns, bool secretOnl void QGpgMEKeyListJob::resultHook(const result_type &tuple) { - mResult = std::get<0>(tuple); for (const Key &key : std::get<1>(tuple)) { Q_EMIT nextKey(key); } diff --git a/lang/qt/src/qgpgmekeylistjob.h b/lang/qt/src/qgpgmekeylistjob.h index f945a6fe..eb25afaf 100644 --- a/lang/qt/src/qgpgmekeylistjob.h +++ b/lang/qt/src/qgpgmekeylistjob.h @@ -80,7 +80,6 @@ public: /* from ThreadedJobMixin */ void resultHook(const result_type &result) override; private: - GpgME::KeyListResult mResult; bool mSecretOnly; }; diff --git a/lang/qt/src/qgpgmelistallkeysjob.cpp b/lang/qt/src/qgpgmelistallkeysjob.cpp index 1c498053..cac09233 100644 --- a/lang/qt/src/qgpgmelistallkeysjob.cpp +++ b/lang/qt/src/qgpgmelistallkeysjob.cpp @@ -92,8 +92,7 @@ private: } QGpgMEListAllKeysJob::QGpgMEListAllKeysJob(Context *context) - : mixin_type(context), - mResult() + : mixin_type(context) { setJobPrivate(this, std::unique_ptr{new QGpgMEListAllKeysJobPrivate{this}}); lateInitialization(); @@ -234,15 +233,9 @@ Error QGpgMEListAllKeysJob::start(bool mergeKeys) KeyListResult QGpgMEListAllKeysJob::exec(std::vector &pub, std::vector &sec, bool mergeKeys) { const result_type r = list_keys(context(), mergeKeys, options()); - resultHook(r); pub = std::get<1>(r); sec = std::get<2>(r); return std::get<0>(r); } -void QGpgMEListAllKeysJob::resultHook(const result_type &tuple) -{ - mResult = std::get<0>(tuple); -} - #include "qgpgmelistallkeysjob.moc" diff --git a/lang/qt/src/qgpgmelistallkeysjob.h b/lang/qt/src/qgpgmelistallkeysjob.h index df365ce2..8234a27f 100644 --- a/lang/qt/src/qgpgmelistallkeysjob.h +++ b/lang/qt/src/qgpgmelistallkeysjob.h @@ -74,12 +74,6 @@ public: /* from ListAllKeysJob */ GpgME::KeyListResult exec(std::vector &pub, std::vector &sec, bool mergeKeys) override; - - /* from ThreadedJobMixin */ - void resultHook(const result_type &result) override; - -private: - GpgME::KeyListResult mResult; }; } diff --git a/lang/qt/src/qgpgmereceivekeysjob.cpp b/lang/qt/src/qgpgmereceivekeysjob.cpp index bedf7a27..6bfc6b56 100644 --- a/lang/qt/src/qgpgmereceivekeysjob.cpp +++ b/lang/qt/src/qgpgmereceivekeysjob.cpp @@ -67,13 +67,7 @@ Error QGpgMEReceiveKeysJob::start(const QStringList &keyIds) GpgME::ImportResult QGpgME::QGpgMEReceiveKeysJob::exec(const QStringList &keyIds) { const result_type r = importfromkeyserver(context(), keyIds); - resultHook(r); - return mResult; -} - -void QGpgME::QGpgMEReceiveKeysJob::resultHook(const result_type &tuple) -{ - mResult = std::get<0>(tuple); + return std::get<0>(r); } #include "qgpgmereceivekeysjob.moc" diff --git a/lang/qt/src/qgpgmereceivekeysjob.h b/lang/qt/src/qgpgmereceivekeysjob.h index 96628df4..51ceefa0 100644 --- a/lang/qt/src/qgpgmereceivekeysjob.h +++ b/lang/qt/src/qgpgmereceivekeysjob.h @@ -66,12 +66,6 @@ public: GpgME::Error start(const QStringList &keyIds) override; GpgME::ImportResult exec(const QStringList &keyIds) override; - - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - -private: - GpgME::ImportResult mResult; }; } diff --git a/lang/qt/src/qgpgmerevokekeyjob.cpp b/lang/qt/src/qgpgmerevokekeyjob.cpp index 8a2c224e..9875b3d3 100644 --- a/lang/qt/src/qgpgmerevokekeyjob.cpp +++ b/lang/qt/src/qgpgmerevokekeyjob.cpp @@ -119,7 +119,6 @@ Error QGpgMERevokeKeyJob::exec(const GpgME::Key &key, Error err = check_arguments(key, reason, description); if (!err) { const result_type r = revoke_key(context(), key, reason, description); - resultHook(r); err = std::get<0>(r); } return err; diff --git a/lang/qt/src/qgpgmesignencryptjob.cpp b/lang/qt/src/qgpgmesignencryptjob.cpp index 27af7ae9..45734d8e 100644 --- a/lang/qt/src/qgpgmesignencryptjob.cpp +++ b/lang/qt/src/qgpgmesignencryptjob.cpp @@ -242,8 +242,7 @@ std::pair QGpgMESignEncryptJob::exec(const std: { const result_type r = sign_encrypt_qba(context(), signers, recipients, plainText, eflags, mOutputIsBase64Encoded, fileName()); cipherText = std::get<2>(r); - resultHook(r); - return mResult; + return std::make_pair(std::get<0>(r), std::get<1>(r)); } std::pair QGpgMESignEncryptJob::exec(const std::vector &signers, const std::vector &recipients, const QByteArray &plainText, bool alwaysTrust, QByteArray &cipherText) @@ -251,11 +250,6 @@ std::pair QGpgMESignEncryptJob::exec(const std: return exec(signers, recipients, plainText, alwaysTrust ? Context::AlwaysTrust : Context::None, cipherText); } -void QGpgMESignEncryptJob::resultHook(const result_type &tuple) -{ - mResult = std::make_pair(std::get<0>(tuple), std::get<1>(tuple)); -} - GpgME::Error QGpgMESignEncryptJobPrivate::startIt() { if (m_inputFilePath.isEmpty() || m_outputFilePath.isEmpty()) { diff --git a/lang/qt/src/qgpgmesignencryptjob.h b/lang/qt/src/qgpgmesignencryptjob.h index cf6053b5..0d24c120 100644 --- a/lang/qt/src/qgpgmesignencryptjob.h +++ b/lang/qt/src/qgpgmesignencryptjob.h @@ -109,12 +109,8 @@ public: /* from SignEncryptJob */ void setOutputIsBase64Encoded(bool on) override; - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - private: bool mOutputIsBase64Encoded; - std::pair mResult; }; } diff --git a/lang/qt/src/qgpgmesignjob.cpp b/lang/qt/src/qgpgmesignjob.cpp index 5c1d9622..dc2516ca 100644 --- a/lang/qt/src/qgpgmesignjob.cpp +++ b/lang/qt/src/qgpgmesignjob.cpp @@ -231,13 +231,7 @@ SigningResult QGpgMESignJob::exec(const std::vector &signers, const QByteAr { const result_type r = sign_qba(context(), signers, plainText, mode, mOutputIsBase64Encoded); signature = std::get<1>(r); - resultHook(r); - return mResult; -} - -void QGpgMESignJob::resultHook(const result_type &tuple) -{ - mResult = std::get<0>(tuple); + return std::get<0>(r); } GpgME::Error QGpgMESignJobPrivate::startIt() diff --git a/lang/qt/src/qgpgmesignjob.h b/lang/qt/src/qgpgmesignjob.h index d4d2577e..59977dba 100644 --- a/lang/qt/src/qgpgmesignjob.h +++ b/lang/qt/src/qgpgmesignjob.h @@ -89,11 +89,7 @@ public: /* from SignJob */ void setOutputIsBase64Encoded(bool on) override; - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - private: - GpgME::SigningResult mResult; bool mOutputIsBase64Encoded; }; diff --git a/lang/qt/src/qgpgmeverifydetachedjob.cpp b/lang/qt/src/qgpgmeverifydetachedjob.cpp index 57b3c368..0a58f59e 100644 --- a/lang/qt/src/qgpgmeverifydetachedjob.cpp +++ b/lang/qt/src/qgpgmeverifydetachedjob.cpp @@ -169,13 +169,7 @@ GpgME::VerificationResult QGpgME::QGpgMEVerifyDetachedJob::exec(const QByteArray const QByteArray &signedData) { const result_type r = verify_detached_qba(context(), signature, signedData); - resultHook(r); - return mResult; -} - -void QGpgME::QGpgMEVerifyDetachedJob::resultHook(const result_type &tuple) -{ - mResult = std::get<0>(tuple); + return std::get<0>(r); } GpgME::Error QGpgMEVerifyDetachedJobPrivate::startIt() diff --git a/lang/qt/src/qgpgmeverifydetachedjob.h b/lang/qt/src/qgpgmeverifydetachedjob.h index 49161396..ec23eccc 100644 --- a/lang/qt/src/qgpgmeverifydetachedjob.h +++ b/lang/qt/src/qgpgmeverifydetachedjob.h @@ -73,12 +73,6 @@ public: /* from VerifyDetachedJob */ GpgME::VerificationResult exec(const QByteArray &signature, const QByteArray &signedData) override; - - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - -private: - GpgME::VerificationResult mResult; }; } diff --git a/lang/qt/src/qgpgmeverifyopaquejob.cpp b/lang/qt/src/qgpgmeverifyopaquejob.cpp index 2ff53227..3a94b8b3 100644 --- a/lang/qt/src/qgpgmeverifyopaquejob.cpp +++ b/lang/qt/src/qgpgmeverifyopaquejob.cpp @@ -184,13 +184,7 @@ GpgME::VerificationResult QGpgME::QGpgMEVerifyOpaqueJob::exec(const QByteArray & { const result_type r = verify_opaque_qba(context(), signedData); plainText = std::get<1>(r); - resultHook(r); - return mResult; -} - -void QGpgME::QGpgMEVerifyOpaqueJob::resultHook(const result_type &tuple) -{ - mResult = std::get<0>(tuple); + return std::get<0>(r); } GpgME::Error QGpgMEVerifyOpaqueJobPrivate::startIt() diff --git a/lang/qt/src/qgpgmeverifyopaquejob.h b/lang/qt/src/qgpgmeverifyopaquejob.h index ae51227c..27464c6b 100644 --- a/lang/qt/src/qgpgmeverifyopaquejob.h +++ b/lang/qt/src/qgpgmeverifyopaquejob.h @@ -72,12 +72,6 @@ public: /* form VerifyOpaqueJob */ GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainData) override; - - /* from ThreadedJobMixin */ - void resultHook(const result_type &r) override; - -private: - GpgME::VerificationResult mResult; }; } diff --git a/lang/qt/src/qgpgmewkdlookupjob.cpp b/lang/qt/src/qgpgmewkdlookupjob.cpp index effacfdc..3917d272 100644 --- a/lang/qt/src/qgpgmewkdlookupjob.cpp +++ b/lang/qt/src/qgpgmewkdlookupjob.cpp @@ -178,7 +178,6 @@ Error QGpgMEWKDLookupJob::start(const QString &email) WKDLookupResult QGpgMEWKDLookupJob::exec(const QString &email) { const result_type r = lookup_keys(context(), email); - resultHook(r); return std::get<0>(r); }