diff --git a/lang/qt/src/defaultkeygenerationjob.h b/lang/qt/src/defaultkeygenerationjob.h index fcefc4b9..0bc7b610 100644 --- a/lang/qt/src/defaultkeygenerationjob.h +++ b/lang/qt/src/defaultkeygenerationjob.h @@ -1,78 +1,78 @@ /* defaultkeygenerationjob.h Copyright (c) 2016 Klarälvdalens Datakonsult AB 2016 Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef QGPGME_DEFAULTKEYGENERATION_H #define QGPGME_DEFAULTKEYGENERATION_H #include "job.h" #include "qgpgme_export.h" namespace GpgME { class KeyGenerationResult; } namespace QGpgME{ /** * Generates a PGP RSA/2048 bit key pair for given name and email address. */ class QGPGME_EXPORT DefaultKeyGenerationJob : public Job { Q_OBJECT public: explicit DefaultKeyGenerationJob(QObject *parent = Q_NULLPTR); ~DefaultKeyGenerationJob(); GpgME::Error start(const QString &email, const QString &name); - QString auditLogAsHtml() const Q_DECL_OVERRIDE; - GpgME::Error auditLogError() const Q_DECL_OVERRIDE; + QString auditLogAsHtml() const override; + GpgME::Error auditLogError() const override; public Q_SLOTS: - void slotCancel() Q_DECL_OVERRIDE; + void slotCancel() override; Q_SIGNALS: void result(const GpgME::KeyGenerationResult &result, const QByteArray &pubkeyData, const QString &auditLogAsHtml, const GpgME::Error &auditLogError); protected: - bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *watched, QEvent *event) override; private: class Private; Private * const d; }; } #endif diff --git a/lang/qt/src/hierarchicalkeylistjob.h b/lang/qt/src/hierarchicalkeylistjob.h index 0ebed3c7..362f036c 100644 --- a/lang/qt/src/hierarchicalkeylistjob.h +++ b/lang/qt/src/hierarchicalkeylistjob.h @@ -1,126 +1,126 @@ /* hierarchicalkeylistjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __KLEO_HIERARCHICALKEYLISTJOB_H__ #define __KLEO_HIERARCHICALKEYLISTJOB_H__ #include "qgpgme_export.h" #include "keylistjob.h" #include "cryptobackend.h" #ifdef BUILDING_QGPGME # include "keylistresult.h" #else #include #endif #include #include namespace GpgME { class Error; class Key; } namespace QGpgME { class KeyListJob; } namespace QGpgME { /** @short A convenience job that additionally fetches all available issuers. To use a HierarchicalKeyListJob, pass it a CryptoBackend implementation, connect the progress() and result() signals to suitable slots and then start the keylisting with a call to start(). This call might fail, in which case the HierarchicalKeyListJob instance will have scheduled it's own destruction with a call to QObject::deleteLater(). After result() is emitted, the HierarchicalKeyListJob will schedule its own destruction by calling QObject::deleteLater(). */ class QGPGME_EXPORT HierarchicalKeyListJob : public KeyListJob { Q_OBJECT public: explicit HierarchicalKeyListJob(const Protocol *protocol, bool remote = false, bool includeSigs = false, bool validating = false); ~HierarchicalKeyListJob(); /** Starts the keylist operation. \a patterns is a list of patterns used to restrict the list of keys returned. Empty patterns are ignored. \a patterns must not be empty or contain only empty patterns; use the normal KeyListJob for a full listing. The \a secretOnly parameter is ignored by HierarchicalKeyListJob and must be set to false. */ - GpgME::Error start(const QStringList &patterns, bool secretOnly = false) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &patterns, bool secretOnly = false) override; GpgME::KeyListResult exec(const QStringList &patterns, bool secretOnly, - std::vector &keys) Q_DECL_OVERRIDE; + std::vector &keys) override; private Q_SLOTS: void slotResult(const GpgME::KeyListResult &); void slotNextKey(const GpgME::Key &key); /* from Job */ - void slotCancel() Q_DECL_OVERRIDE; + void slotCancel() override; private: GpgME::Error startAJob(); private: const Protocol *const mProtocol; const bool mRemote; const bool mIncludeSigs; const bool mValidating; bool mTruncated; std::set mSentSet; // keys already sent (prevent duplicates even if the backend should return them) std::set mScheduledSet; // keys already scheduled (by starting a job for them) std::set mNextSet; // keys to schedule for the next iteraton GpgME::KeyListResult mIntermediateResult; QPointer mJob; }; } #endif // __KLEO_HIERARCHICALKEYLISTJOB_H__ diff --git a/lang/qt/src/multideletejob.h b/lang/qt/src/multideletejob.h index a6eec1f1..308490fa 100644 --- a/lang/qt/src/multideletejob.h +++ b/lang/qt/src/multideletejob.h @@ -1,108 +1,108 @@ /* multideletejob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __KLEO_MULTIDELETEJOB_H__ #define __KLEO_MULTIDELETEJOB_H__ #include "qgpgme_export.h" #include "job.h" #include "protocol.h" #include #include namespace GpgME { class Error; class Key; } namespace QGpgME { class DeleteJob; } namespace QGpgME { /** @short A convenience class bundling together multiple DeleteJobs. To use a MultiDeleteJob, pass it a CryptoBackend implementation, connect the progress() and result() signals to suitable slots and then start the delete with a call to start(). This call might fail, in which case the MultiDeleteJob instance will have scheduled it's own destruction with a call to QObject::deleteLater(). After result() is emitted, the MultiDeleteJob will schedule it's own destruction by calling QObject::deleteLater(). */ class QGPGME_EXPORT MultiDeleteJob : public Job { Q_OBJECT public: explicit MultiDeleteJob(const Protocol *protocol); ~MultiDeleteJob(); /** Starts the delete operation. \a keys is the list of keys to delete, \a allowSecretKeyDeletion specifies if a key may also be deleted if the secret key part is available, too. */ GpgME::Error start(const std::vector &keys, bool allowSecretKeyDeletion = false); /* from Job */ - void slotCancel() Q_DECL_OVERRIDE; + void slotCancel() override; Q_SIGNALS: void result(const GpgME::Error &result, const GpgME::Key &errorKey); private Q_SLOTS: void slotResult(const GpgME::Error &); private: GpgME::Error startAJob(); private: const Protocol *mProtocol; QPointer mJob; std::vector mKeys; std::vector::const_iterator mIt; bool mAllowSecretKeyDeletion; }; } #endif // __KLEO_MULTIDELETEJOB_H__ diff --git a/lang/qt/src/protocol_p.h b/lang/qt/src/protocol_p.h index 685ac4dd..915fef99 100644 --- a/lang/qt/src/protocol_p.h +++ b/lang/qt/src/protocol_p.h @@ -1,512 +1,512 @@ /* protocol_p.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH Copyright (c) 2022 by g10 Code GmbH Software engineering by Ingo Klöcker QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_PROTOCOL_P_H__ #define __QGPGME_PROTOCOL_P_H__ #include "qgpgmenewcryptoconfig.h" #include "qgpgmekeygenerationjob.h" #include "qgpgmekeylistjob.h" #include "qgpgmelistallkeysjob.h" #include "qgpgmedecryptjob.h" #include "qgpgmedecryptverifyjob.h" #include "qgpgmerefreshsmimekeysjob.h" #include "qgpgmedeletejob.h" #include "qgpgmedownloadjob.h" #include "qgpgmesignencryptjob.h" #include "qgpgmeencryptjob.h" #include "qgpgmesignjob.h" #include "qgpgmesignkeyjob.h" #include "qgpgmeexportjob.h" #include "qgpgmeverifydetachedjob.h" #include "qgpgmeimportjob.h" #include "qgpgmeimportfromkeyserverjob.h" #include "qgpgmeverifyopaquejob.h" #include "qgpgmechangeexpiryjob.h" #include "qgpgmechangeownertrustjob.h" #include "qgpgmechangepasswdjob.h" #include "qgpgmeaddexistingsubkeyjob.h" #include "qgpgmeadduseridjob.h" #include "qgpgmekeyformailboxjob.h" #include "qgpgmewkdlookupjob.h" #include "qgpgmewkspublishjob.h" #include "qgpgmetofupolicyjob.h" #include "qgpgmequickjob.h" #include "qgpgmereceivekeysjob.h" #include "qgpgmerevokekeyjob.h" #include "qgpgmesetprimaryuseridjob.h" namespace { class Protocol : public QGpgME::Protocol { GpgME::Protocol mProtocol; public: explicit Protocol(GpgME::Protocol proto) : mProtocol(proto) {} - QString name() const Q_DECL_OVERRIDE + QString name() const override { switch (mProtocol) { case GpgME::OpenPGP: return QStringLiteral("OpenPGP"); case GpgME::CMS: return QStringLiteral("SMIME"); default: return QString(); } } - QString displayName() const Q_DECL_OVERRIDE + QString displayName() const override { // ah (2.4.16): Where is this used and isn't this inverted // with name switch (mProtocol) { case GpgME::OpenPGP: return QStringLiteral("gpg"); case GpgME::CMS: return QStringLiteral("gpgsm"); default: return QStringLiteral("unknown"); } } - QGpgME::SpecialJob *specialJob(const char *, const QMap &) const Q_DECL_OVERRIDE + QGpgME::SpecialJob *specialJob(const char *, const QMap &) const override { return nullptr; } - QGpgME::KeyListJob *keyListJob(bool remote, bool includeSigs, bool validate) const Q_DECL_OVERRIDE + QGpgME::KeyListJob *keyListJob(bool remote, bool includeSigs, bool validate) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } unsigned int mode = context->keyListMode(); if (remote) { mode |= GpgME::Extern; mode &= ~GpgME::Local; } else { mode |= GpgME::Local; mode &= ~GpgME::Extern; } if (includeSigs) { mode |= GpgME::Signatures; } if (validate) { mode |= GpgME::Validate; } context->setKeyListMode(mode); return new QGpgME::QGpgMEKeyListJob(context); } - QGpgME::ListAllKeysJob *listAllKeysJob(bool includeSigs, bool validate) const Q_DECL_OVERRIDE + QGpgME::ListAllKeysJob *listAllKeysJob(bool includeSigs, bool validate) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } unsigned int mode = context->keyListMode(); mode |= GpgME::Local; mode &= ~GpgME::Extern; if (includeSigs) { mode |= GpgME::Signatures; } if (validate) { mode |= GpgME::Validate; /* Setting the context to offline mode disables CRL / OCSP checks in this Job. Otherwise we would try to fetch the CRL's for all CMS keys in the users keyring because GpgME::Validate includes remote resources by default in the validity check. This setting only has any effect if gpgsm >= 2.1.6 is used. */ context->setOffline(true); } context->setKeyListMode(mode); return new QGpgME::QGpgMEListAllKeysJob(context); } - QGpgME::EncryptJob *encryptJob(bool armor, bool textmode) const Q_DECL_OVERRIDE + QGpgME::EncryptJob *encryptJob(bool armor, bool textmode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setArmor(armor); context->setTextMode(textmode); return new QGpgME::QGpgMEEncryptJob(context); } - QGpgME::DecryptJob *decryptJob() const Q_DECL_OVERRIDE + QGpgME::DecryptJob *decryptJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEDecryptJob(context); } - QGpgME::SignJob *signJob(bool armor, bool textMode) const Q_DECL_OVERRIDE + QGpgME::SignJob *signJob(bool armor, bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setArmor(armor); context->setTextMode(textMode); return new QGpgME::QGpgMESignJob(context); } - QGpgME::VerifyDetachedJob *verifyDetachedJob(bool textMode) const Q_DECL_OVERRIDE + QGpgME::VerifyDetachedJob *verifyDetachedJob(bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setTextMode(textMode); return new QGpgME::QGpgMEVerifyDetachedJob(context); } - QGpgME::VerifyOpaqueJob *verifyOpaqueJob(bool textMode) const Q_DECL_OVERRIDE + QGpgME::VerifyOpaqueJob *verifyOpaqueJob(bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setTextMode(textMode); return new QGpgME::QGpgMEVerifyOpaqueJob(context); } - QGpgME::KeyGenerationJob *keyGenerationJob() const Q_DECL_OVERRIDE + QGpgME::KeyGenerationJob *keyGenerationJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEKeyGenerationJob(context); } - QGpgME::ImportJob *importJob() const Q_DECL_OVERRIDE + QGpgME::ImportJob *importJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEImportJob(context); } - QGpgME::ImportFromKeyserverJob *importFromKeyserverJob() const Q_DECL_OVERRIDE + QGpgME::ImportFromKeyserverJob *importFromKeyserverJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEImportFromKeyserverJob(context); } QGpgME::ReceiveKeysJob *receiveKeysJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEReceiveKeysJob{context}; } - QGpgME::ExportJob *publicKeyExportJob(bool armor) const Q_DECL_OVERRIDE + QGpgME::ExportJob *publicKeyExportJob(bool armor) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setArmor(armor); return new QGpgME::QGpgMEExportJob(context); } - QGpgME::ExportJob *secretKeyExportJob(bool armor, const QString &) const Q_DECL_OVERRIDE + QGpgME::ExportJob *secretKeyExportJob(bool armor, const QString &) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setArmor(armor); return new QGpgME::QGpgMEExportJob(context, GpgME::Context::ExportSecret); } - QGpgME::ExportJob *secretSubkeyExportJob(bool armor) const Q_DECL_OVERRIDE + QGpgME::ExportJob *secretSubkeyExportJob(bool armor) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setArmor(armor); return new QGpgME::QGpgMEExportJob(context, GpgME::Context::ExportSecretSubkey); } - QGpgME::RefreshKeysJob *refreshKeysJob() const Q_DECL_OVERRIDE + QGpgME::RefreshKeysJob *refreshKeysJob() const override { if (mProtocol != GpgME::CMS) { return nullptr; } return new QGpgME::QGpgMERefreshSMIMEKeysJob; } - QGpgME::DownloadJob *downloadJob(bool armor) const Q_DECL_OVERRIDE + QGpgME::DownloadJob *downloadJob(bool armor) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setArmor(armor); // this is the hackish interface for downloading from keyserers currently: context->setKeyListMode(GpgME::Extern); return new QGpgME::QGpgMEDownloadJob(context); } - QGpgME::DeleteJob *deleteJob() const Q_DECL_OVERRIDE + QGpgME::DeleteJob *deleteJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEDeleteJob(context); } - QGpgME::SignEncryptJob *signEncryptJob(bool armor, bool textMode) const Q_DECL_OVERRIDE + QGpgME::SignEncryptJob *signEncryptJob(bool armor, bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setArmor(armor); context->setTextMode(textMode); return new QGpgME::QGpgMESignEncryptJob(context); } - QGpgME::DecryptVerifyJob *decryptVerifyJob(bool textMode) const Q_DECL_OVERRIDE + QGpgME::DecryptVerifyJob *decryptVerifyJob(bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setTextMode(textMode); return new QGpgME::QGpgMEDecryptVerifyJob(context); } - QGpgME::ChangeExpiryJob *changeExpiryJob() const Q_DECL_OVERRIDE + QGpgME::ChangeExpiryJob *changeExpiryJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; // only supported by gpg } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEChangeExpiryJob(context); } - QGpgME::ChangePasswdJob *changePasswdJob() const Q_DECL_OVERRIDE + QGpgME::ChangePasswdJob *changePasswdJob() const override { if (!GpgME::hasFeature(GpgME::PasswdFeature, 0)) { return nullptr; } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEChangePasswdJob(context); } - QGpgME::SignKeyJob *signKeyJob() const Q_DECL_OVERRIDE + QGpgME::SignKeyJob *signKeyJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; // only supported by gpg } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMESignKeyJob(context); } - QGpgME::ChangeOwnerTrustJob *changeOwnerTrustJob() const Q_DECL_OVERRIDE + QGpgME::ChangeOwnerTrustJob *changeOwnerTrustJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; // only supported by gpg } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEChangeOwnerTrustJob(context); } QGpgME:: AddExistingSubkeyJob *addExistingSubkeyJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; // only supported by gpg } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEAddExistingSubkeyJob{context}; } - QGpgME::AddUserIDJob *addUserIDJob() const Q_DECL_OVERRIDE + QGpgME::AddUserIDJob *addUserIDJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; // only supported by gpg } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEAddUserIDJob(context); } - QGpgME::KeyListJob *locateKeysJob() const Q_DECL_OVERRIDE + QGpgME::KeyListJob *locateKeysJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } context->setKeyListMode(GpgME::Locate | GpgME::Signatures | GpgME::Validate); return new QGpgME::QGpgMEKeyListJob(context); } - QGpgME::KeyForMailboxJob *keyForMailboxJob() const Q_DECL_OVERRIDE + QGpgME::KeyForMailboxJob *keyForMailboxJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEKeyForMailboxJob(context); } - QGpgME::WKDLookupJob *wkdLookupJob() const Q_DECL_OVERRIDE + QGpgME::WKDLookupJob *wkdLookupJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; } auto context = GpgME::Context::createForEngine(GpgME::AssuanEngine); if (!context) { return nullptr; } return new QGpgME::QGpgMEWKDLookupJob(context.release()); } - QGpgME::WKSPublishJob *wksPublishJob() const Q_DECL_OVERRIDE + QGpgME::WKSPublishJob *wksPublishJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; } auto context = GpgME::Context::createForEngine(GpgME::SpawnEngine); if (!context) { return nullptr; } return new QGpgME::QGpgMEWKSPublishJob(context.release()); } - QGpgME::TofuPolicyJob *tofuPolicyJob() const Q_DECL_OVERRIDE + QGpgME::TofuPolicyJob *tofuPolicyJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMETofuPolicyJob(context); } - QGpgME::QuickJob *quickJob() const Q_DECL_OVERRIDE + QGpgME::QuickJob *quickJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMEQuickJob(context); } - QGpgME::RevokeKeyJob *revokeKeyJob() const Q_DECL_OVERRIDE + QGpgME::RevokeKeyJob *revokeKeyJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMERevokeKeyJob(context); } QGpgME::SetPrimaryUserIDJob *setPrimaryUserIDJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; } GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { return nullptr; } return new QGpgME::QGpgMESetPrimaryUserIDJob{context}; } }; } #endif diff --git a/lang/qt/src/qgpgmeadduseridjob.h b/lang/qt/src/qgpgmeadduseridjob.h index 71fa4730..26395ba5 100644 --- a/lang/qt/src/qgpgmeadduseridjob.h +++ b/lang/qt/src/qgpgmeadduseridjob.h @@ -1,66 +1,66 @@ /* qgpgmeadduseridjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEADDUSERIDJOB_H__ #define __QGPGME_QGPGMEADDUSERIDJOB_H__ #include "adduseridjob.h" #include "threadedjobmixin.h" namespace QGpgME { class QGpgMEAddUserIDJob #ifdef Q_MOC_RUN : public AddUserIDJob #else : public _detail::ThreadedJobMixin #endif { Q_OBJECT #ifdef Q_MOC_RUN private Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEAddUserIDJob(GpgME::Context *context); ~QGpgMEAddUserIDJob(); /* from AddUserIDJob */ - GpgME::Error start(const GpgME::Key &key, const QString &name, const QString &email, const QString &comment) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key, const QString &name, const QString &email, const QString &comment) override; }; } #endif // __QGPGME_QGPGMEADDUSERIDJOB_H__ diff --git a/lang/qt/src/qgpgmechangeexpiryjob.h b/lang/qt/src/qgpgmechangeexpiryjob.h index bb9b9ba8..ac66e4f7 100644 --- a/lang/qt/src/qgpgmechangeexpiryjob.h +++ b/lang/qt/src/qgpgmechangeexpiryjob.h @@ -1,72 +1,72 @@ /* qgpgmechangeexpiryjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMECHANGEEXPIRYJOB_H__ #define __QGPGME_QGPGMECHANGEEXPIRYJOB_H__ #include "changeexpiryjob.h" #include "threadedjobmixin.h" namespace QGpgME { class QGpgMEChangeExpiryJob #ifdef Q_MOC_RUN : public ChangeExpiryJob #else : public _detail::ThreadedJobMixin #endif { Q_OBJECT #ifdef Q_MOC_RUN private Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEChangeExpiryJob(GpgME::Context *context); ~QGpgMEChangeExpiryJob(); /* from ChangeExpiryJob */ - GpgME::Error start(const GpgME::Key &key, const QDateTime &expiry) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key, const QDateTime &expiry) override; /* from ChangeExpiryJob */ GpgME::Error start(const GpgME::Key &key, const QDateTime &expiry, - const std::vector &subkeys) Q_DECL_OVERRIDE; + const std::vector &subkeys) override; }; } #endif // __QGPGME_QGPGMECHANGEEXPIRYJOB_H__ diff --git a/lang/qt/src/qgpgmechangeownertrustjob.h b/lang/qt/src/qgpgmechangeownertrustjob.h index 0f4dbe64..387166e2 100644 --- a/lang/qt/src/qgpgmechangeownertrustjob.h +++ b/lang/qt/src/qgpgmechangeownertrustjob.h @@ -1,66 +1,66 @@ /* qgpgmechangeownertrustjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMECHANGEOWNERTRUSTJOB_H__ #define __QGPGME_QGPGMECHANGEOWNERTRUSTJOB_H__ #include "changeownertrustjob.h" #include "threadedjobmixin.h" namespace QGpgME { class QGpgMEChangeOwnerTrustJob #ifdef Q_MOC_RUN : public ChangeOwnerTrustJob #else : public _detail::ThreadedJobMixin #endif { Q_OBJECT #ifdef Q_MOC_RUN private Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEChangeOwnerTrustJob(GpgME::Context *context); ~QGpgMEChangeOwnerTrustJob(); /* from ChangeOwnerTrustJob */ - GpgME::Error start(const GpgME::Key &key, GpgME::Key::OwnerTrust trust) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key, GpgME::Key::OwnerTrust trust) override; }; } #endif // __QGPGME_QGPGMECHANGEOWNERTRUSTJOB_H__ diff --git a/lang/qt/src/qgpgmechangepasswdjob.h b/lang/qt/src/qgpgmechangepasswdjob.h index 8910a460..fbd9caa5 100644 --- a/lang/qt/src/qgpgmechangepasswdjob.h +++ b/lang/qt/src/qgpgmechangepasswdjob.h @@ -1,67 +1,67 @@ /* qgpgmechangepasswdjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2010 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMECHANGEPASSWDJOB_H__ #define __QGPGME_QGPGMECHANGEPASSWDJOB_H__ #include "changepasswdjob.h" #include "threadedjobmixin.h" namespace QGpgME { class QGpgMEChangePasswdJob #ifdef Q_MOC_RUN : public ChangePasswdJob #else : public _detail::ThreadedJobMixin #endif { Q_OBJECT #ifdef Q_MOC_RUN private Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEChangePasswdJob(GpgME::Context *context); ~QGpgMEChangePasswdJob(); /* from ChangePasswdJob */ - GpgME::Error start(const GpgME::Key &key) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key) override; }; } #endif // __QGPGME_QGPGMECHANGEPASSWDJOB_H__ diff --git a/lang/qt/src/qgpgmedecryptjob.h b/lang/qt/src/qgpgmedecryptjob.h index 2924378c..ea648667 100644 --- a/lang/qt/src/qgpgmedecryptjob.h +++ b/lang/qt/src/qgpgmedecryptjob.h @@ -1,85 +1,85 @@ /* qgpgmedecryptjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEDECRYPTJOB_H__ #define __QGPGME_QGPGMEDECRYPTJOB_H__ #include "decryptjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "decryptionresult.h" #else #include #endif namespace QGpgME { class QGpgMEDecryptJob #ifdef Q_MOC_RUN : public DecryptJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN private Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEDecryptJob(GpgME::Context *context); ~QGpgMEDecryptJob(); /* from DecryptJob */ - GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &cipherText) override; /* from DecryptJob */ - void start(const std::shared_ptr &cipherText, const std::shared_ptr &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr &cipherText, const std::shared_ptr &plainText) override; /* from DecryptJob */ GpgME::DecryptionResult exec(const QByteArray &cipherText, - QByteArray &plainText) Q_DECL_OVERRIDE; + QByteArray &plainText) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::DecryptionResult mResult; }; } #endif // __QGPGME_QGPGMEDECRYPTJOB_H__ diff --git a/lang/qt/src/qgpgmedecryptverifyjob.h b/lang/qt/src/qgpgmedecryptverifyjob.h index eaeec095..01794319 100644 --- a/lang/qt/src/qgpgmedecryptverifyjob.h +++ b/lang/qt/src/qgpgmedecryptverifyjob.h @@ -1,90 +1,90 @@ /* qgpgmedecryptverifyjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEDECRYPTVERIFYJOB_H__ #define __QGPGME_QGPGMEDECRYPTVERIFYJOB_H__ #include "decryptverifyjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "decryptionresult.h" #else #include #endif #ifdef BUILDING_QGPGME # include "verificationresult.h" #else #include #endif namespace QGpgME { class QGpgMEDecryptVerifyJob #ifdef Q_MOC_RUN : public DecryptVerifyJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN private Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEDecryptVerifyJob(GpgME::Context *context); ~QGpgMEDecryptVerifyJob(); /* from DecryptVerifyJob */ - GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &cipherText) override; /* from DecryptVerifyJob */ - void start(const std::shared_ptr &cipherText, const std::shared_ptr &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr &cipherText, const std::shared_ptr &plainText) override; /* from DecryptVerifyJob */ std::pair - exec(const QByteArray &cipherText, QByteArray &plainText) Q_DECL_OVERRIDE; + exec(const QByteArray &cipherText, QByteArray &plainText) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: std::pair mResult; }; } #endif // __QGPGME_QGPGMEDECRYPTVERIFYJOB_H__ diff --git a/lang/qt/src/qgpgmedeletejob.h b/lang/qt/src/qgpgmedeletejob.h index f5d586b5..6228a50c 100644 --- a/lang/qt/src/qgpgmedeletejob.h +++ b/lang/qt/src/qgpgmedeletejob.h @@ -1,72 +1,72 @@ /* qgpgmedeletejob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEDELETEJOB_H__ #define __QGPGME_QGPGMEDELETEJOB_H__ #include "deletejob.h" #include "threadedjobmixin.h" namespace GpgME { class Key; } namespace QGpgME { class QGpgMEDeleteJob #ifdef Q_MOC_RUN : public DeleteJob #else : public _detail::ThreadedJobMixin #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEDeleteJob(GpgME::Context *context); ~QGpgMEDeleteJob(); /* from DeleteJob */ - GpgME::Error start(const GpgME::Key &key, bool allowSecretKeyDeletion) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key, bool allowSecretKeyDeletion) override; }; } #endif // __QGPGME_QGPGMEDELETEJOB_H__ diff --git a/lang/qt/src/qgpgmedownloadjob.h b/lang/qt/src/qgpgmedownloadjob.h index 248c28f5..8aab7479 100644 --- a/lang/qt/src/qgpgmedownloadjob.h +++ b/lang/qt/src/qgpgmedownloadjob.h @@ -1,70 +1,70 @@ /* qgpgmedownloadjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEDOWNLOADJOB_H__ #define __QGPGME_QGPGMEDOWNLOADJOB_H__ #include "downloadjob.h" #include "threadedjobmixin.h" namespace QGpgME { class QGpgMEDownloadJob #ifdef Q_MOC_RUN : public DownloadJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEDownloadJob(GpgME::Context *context); ~QGpgMEDownloadJob(); /* from DownloadJob */ - GpgME::Error start(const QStringList &fingerprints) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &fingerprints) override; /* from DownloadJob */ - GpgME::Error start(const QByteArray &fingerprint, const std::shared_ptr &keyData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &fingerprint, const std::shared_ptr &keyData) override; }; } #endif // __QGPGME_QGPGMEDOWNLOADJOB_H__ diff --git a/lang/qt/src/qgpgmeencryptjob.h b/lang/qt/src/qgpgmeencryptjob.h index cba5ec99..07b05f8f 100644 --- a/lang/qt/src/qgpgmeencryptjob.h +++ b/lang/qt/src/qgpgmeencryptjob.h @@ -1,110 +1,110 @@ /* qgpgmeencryptjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEENCRYPTJOB_H__ #define __QGPGME_QGPGMEENCRYPTJOB_H__ #include "encryptjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "encryptionresult.h" #else #include #endif #ifdef BUILDING_QGPGME # include "key.h" #else #include #endif namespace QGpgME { class QGpgMEEncryptJob #ifdef Q_MOC_RUN : public EncryptJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEEncryptJob(GpgME::Context *context); ~QGpgMEEncryptJob(); /* from EncryptJob */ GpgME::Error start(const std::vector &recipients, - const QByteArray &plainText, bool alwaysTrust) Q_DECL_OVERRIDE; + const QByteArray &plainText, bool alwaysTrust) override; /* from EncryptJob */ void start(const std::vector &recipients, const std::shared_ptr &plainText, const std::shared_ptr &cipherText, - bool alwaysTrust) Q_DECL_OVERRIDE; + bool alwaysTrust) override; /* from EncryptJob */ GpgME::EncryptionResult exec(const std::vector &recipients, const QByteArray &plainText, bool alwaysTrust, - QByteArray &cipherText) Q_DECL_OVERRIDE; + QByteArray &cipherText) override; /* from EncryptJob */ void start(const std::vector &recipients, const std::shared_ptr &plainText, const std::shared_ptr &cipherText, - const GpgME::Context::EncryptionFlags flags) Q_DECL_OVERRIDE; + const GpgME::Context::EncryptionFlags flags) override; /* from EncryptJob */ GpgME::EncryptionResult exec(const std::vector &recipients, const QByteArray &plainText, const GpgME::Context::EncryptionFlags flags, - QByteArray &cipherText) Q_DECL_OVERRIDE; + QByteArray &cipherText) override; /* from EncryptJob */ - void setOutputIsBase64Encoded(bool on) Q_DECL_OVERRIDE; + void setOutputIsBase64Encoded(bool on) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: bool mOutputIsBase64Encoded; GpgME::EncryptionResult mResult; }; } #endif // __QGPGME_QGPGMEENCRYPTJOB_H__ diff --git a/lang/qt/src/qgpgmeexportjob.h b/lang/qt/src/qgpgmeexportjob.h index b77bad1c..272fff4d 100644 --- a/lang/qt/src/qgpgmeexportjob.h +++ b/lang/qt/src/qgpgmeexportjob.h @@ -1,80 +1,80 @@ /* qgpgmeexportjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH Copyright (c) 2022 by g10 Code GmbH Software engineering by Ingo Klöcker QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEEXPORTJOB_H__ #define __QGPGME_QGPGMEEXPORTJOB_H__ #include "exportjob.h" #include "threadedjobmixin.h" namespace QGpgME { class QGpgMEExportJob #ifdef Q_MOC_RUN : public ExportJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEExportJob(GpgME::Context *context); // Creates an export job with forced export mode @p exportMode. The // export mode flags set with @p exportMode cannot be overridden with // setExportFlags. explicit QGpgMEExportJob(GpgME::Context *context, unsigned int exportMode); - ~QGpgMEExportJob() Q_DECL_OVERRIDE; + ~QGpgMEExportJob() override; /* from ExportJob */ - void setExportFlags(unsigned int flags) Q_DECL_OVERRIDE; + void setExportFlags(unsigned int flags) override; /* from ExportJob */ - GpgME::Error start(const QStringList &patterns) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &patterns) override; private: unsigned int m_exportMode; unsigned int m_additionalExportModeFlags; }; } #endif // __QGPGME_QGPGMEEXPORTJOB_H__ diff --git a/lang/qt/src/qgpgmegpgcardjob.h b/lang/qt/src/qgpgmegpgcardjob.h index bed68b2d..c78c0ee5 100644 --- a/lang/qt/src/qgpgmegpgcardjob.h +++ b/lang/qt/src/qgpgmegpgcardjob.h @@ -1,63 +1,63 @@ /* qgpgmegpgcardjob.h This file is part of libkleopatra, the KDE keymanagement library Copyright (c) 2020 g10 Code GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEGPGCARDJOB_H__ #define __QGPGME_QGPGMEGPGCARDJOB_H__ #include "gpgcardjob.h" #include "threadedjobmixin.h" namespace QGpgME { class QGpgMEGpgCardJob #ifdef Q_MOC_RUN : public GpgCardJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEGpgCardJob(); ~QGpgMEGpgCardJob(); - GpgME::Error start(const QStringList &cmds) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &cmds) override; - GpgME::Error exec(const QStringList &cmds, QString &std_out, QString &std_err, int &exitCode) Q_DECL_OVERRIDE; + GpgME::Error exec(const QStringList &cmds, QString &std_out, QString &std_err, int &exitCode) override; }; } #endif diff --git a/lang/qt/src/qgpgmeimportfromkeyserverjob.h b/lang/qt/src/qgpgmeimportfromkeyserverjob.h index 6ecce81b..1dfcbc19 100644 --- a/lang/qt/src/qgpgmeimportfromkeyserverjob.h +++ b/lang/qt/src/qgpgmeimportfromkeyserverjob.h @@ -1,82 +1,82 @@ /* qgpgmeimportfromkeyserverjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEIMPORTFROMKEYSERVERJOB_H__ #define __QGPGME_QGPGMEIMPORTFROMKEYSERVERJOB_H__ #include "importfromkeyserverjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "importresult.h" #else #include #endif namespace QGpgME { class QGpgMEImportFromKeyserverJob #ifdef Q_MOC_RUN : public ImportFromKeyserverJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEImportFromKeyserverJob(GpgME::Context *context); ~QGpgMEImportFromKeyserverJob(); /* from ImportFromKeyserverJob */ - GpgME::Error start(const std::vector &keys) Q_DECL_OVERRIDE; + GpgME::Error start(const std::vector &keys) override; /* from ImportFromKeyserverJob */ - GpgME::ImportResult exec(const std::vector &keys) Q_DECL_OVERRIDE; + GpgME::ImportResult exec(const std::vector &keys) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::ImportResult mResult; }; } #endif // __QGPGME_QGPGMEIMPORTFROMKEYSERVERJOB_H__ diff --git a/lang/qt/src/qgpgmeimportjob.h b/lang/qt/src/qgpgmeimportjob.h index ec4d39b4..4c22ae92 100644 --- a/lang/qt/src/qgpgmeimportjob.h +++ b/lang/qt/src/qgpgmeimportjob.h @@ -1,86 +1,86 @@ /* qgpgmeimportjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH Copyright (c) 2023 g10 Code GmbH Software engineering by Ingo Klöcker QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEIMPORTJOB_H__ #define __QGPGME_QGPGMEIMPORTJOB_H__ #include "importjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "importresult.h" #else #include #endif namespace QGpgME { class QGpgMEImportJob #ifdef Q_MOC_RUN : public ImportJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEImportJob(GpgME::Context *context); ~QGpgMEImportJob(); /* from ImportJob */ - GpgME::Error start(const QByteArray &keyData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &keyData) override; /* from ImportJob */ - GpgME::ImportResult exec(const QByteArray &keyData) Q_DECL_OVERRIDE; + GpgME::ImportResult exec(const QByteArray &keyData) override; GpgME::Error startLater(const QByteArray &keyData) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::ImportResult mResult; }; } #endif // __QGPGME_QGPGMEIMPORTJOB_H__ diff --git a/lang/qt/src/qgpgmekeyformailboxjob.h b/lang/qt/src/qgpgmekeyformailboxjob.h index a14e470b..8c26691a 100644 --- a/lang/qt/src/qgpgmekeyformailboxjob.h +++ b/lang/qt/src/qgpgmekeyformailboxjob.h @@ -1,85 +1,85 @@ /* qgpgmekeyformailboxjob.h This file is part of libkleopatra, the KDE keymanagement library Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEKEYFORMAILBOXJOB_H__ #define __QGPGME_QGPGMEKEYFORMAILBOXJOB_H__ #include "keyformailboxjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "keylistresult.h" # include "key.h" #else # include # include #endif namespace QGpgME { class QGpgMEKeyForMailboxJob #ifdef Q_MOC_RUN : public KeyForMailboxJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEKeyForMailboxJob(GpgME::Context *context); ~QGpgMEKeyForMailboxJob(); /** Starts the operation. \a mailbox is the mailbox to look for. The result is the same as for the LocateKeysJob. If \a canEncrypt is true, only keys that have a subkey for encryption usage are returned. Use this if you need to select a key for signing. */ - GpgME::Error start(const QString &mailbox, bool canEncrypt = true) Q_DECL_OVERRIDE; + GpgME::Error start(const QString &mailbox, bool canEncrypt = true) override; - GpgME::KeyListResult exec(const QString &mailbox, bool canEncrypt, GpgME::Key &key, GpgME::UserID &uid) Q_DECL_OVERRIDE; + GpgME::KeyListResult exec(const QString &mailbox, bool canEncrypt, GpgME::Key &key, GpgME::UserID &uid) override; }; } #endif diff --git a/lang/qt/src/qgpgmekeygenerationjob.h b/lang/qt/src/qgpgmekeygenerationjob.h index 1fa28d5d..31ee003f 100644 --- a/lang/qt/src/qgpgmekeygenerationjob.h +++ b/lang/qt/src/qgpgmekeygenerationjob.h @@ -1,73 +1,73 @@ /* qgpgmekeygenerationjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEKEYGENERATIONJOB_H__ #define __QGPGME_QGPGMEKEYGENERATIONJOB_H__ #include "keygenerationjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "keygenerationresult.h" #else #include #endif namespace QGpgME { class QGpgMEKeyGenerationJob #ifdef Q_MOC_RUN : public KeyGenerationJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN private Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEKeyGenerationJob(GpgME::Context *context); ~QGpgMEKeyGenerationJob(); /* from KeygenerationJob */ - GpgME::Error start(const QString ¶meters) Q_DECL_OVERRIDE; + GpgME::Error start(const QString ¶meters) override; }; } #endif // __QGPGME_QGPGMEKEYGENERATIONJOB_H__ diff --git a/lang/qt/src/qgpgmekeylistjob.h b/lang/qt/src/qgpgmekeylistjob.h index 9e505a10..f945a6fe 100644 --- a/lang/qt/src/qgpgmekeylistjob.h +++ b/lang/qt/src/qgpgmekeylistjob.h @@ -1,89 +1,89 @@ /* qgpgmekeylistjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEKEYLISTJOB_H__ #define __QGPGME_QGPGMEKEYLISTJOB_H__ #include "keylistjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "keylistresult.h" #else #include #endif #ifdef BUILDING_QGPGME # include "key.h" #else #include #endif namespace QGpgME { class QGpgMEKeyListJob #ifdef Q_MOC_RUN : public KeyListJob #else : public _detail::ThreadedJobMixin, QString, GpgME::Error> > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEKeyListJob(GpgME::Context *context); ~QGpgMEKeyListJob(); /* from KeyListJob */ - GpgME::Error start(const QStringList &patterns, bool secretOnly) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &patterns, bool secretOnly) override; /* from KeyListJob */ - GpgME::KeyListResult exec(const QStringList &patterns, bool secretOnly, std::vector &keys) Q_DECL_OVERRIDE; + GpgME::KeyListResult exec(const QStringList &patterns, bool secretOnly, std::vector &keys) override; - void addMode(GpgME::KeyListMode mode) Q_DECL_OVERRIDE; + void addMode(GpgME::KeyListMode mode) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &result) Q_DECL_OVERRIDE; + void resultHook(const result_type &result) override; private: GpgME::KeyListResult mResult; bool mSecretOnly; }; } #endif // __QGPGME_QGPGMEKEYLISTJOB_H__ diff --git a/lang/qt/src/qgpgmelistallkeysjob.h b/lang/qt/src/qgpgmelistallkeysjob.h index 091f9f15..df365ce2 100644 --- a/lang/qt/src/qgpgmelistallkeysjob.h +++ b/lang/qt/src/qgpgmelistallkeysjob.h @@ -1,87 +1,87 @@ /* qgpgmelistallkeysjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMELISTALLKEYSJOB_H__ #define __QGPGME_QGPGMELISTALLKEYSJOB_H__ #include "listallkeysjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "keylistresult.h" #else #include #endif #ifdef BUILDING_QGPGME # include "key.h" #else #include #endif namespace QGpgME { class QGpgMEListAllKeysJob #ifdef Q_MOC_RUN : public ListAllKeysJob #else : public _detail::ThreadedJobMixin, std::vector, QString, GpgME::Error> > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEListAllKeysJob(GpgME::Context *context); ~QGpgMEListAllKeysJob(); /* from ListAllKeysJob */ - GpgME::Error start(bool mergeKeys) Q_DECL_OVERRIDE; + GpgME::Error start(bool mergeKeys) override; /* from ListAllKeysJob */ - GpgME::KeyListResult exec(std::vector &pub, std::vector &sec, bool mergeKeys) Q_DECL_OVERRIDE; + GpgME::KeyListResult exec(std::vector &pub, std::vector &sec, bool mergeKeys) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &result) Q_DECL_OVERRIDE; + void resultHook(const result_type &result) override; private: GpgME::KeyListResult mResult; }; } #endif // __QGPGME_QGPGMELISTALLKEYSJOB_H__ diff --git a/lang/qt/src/qgpgmenewcryptoconfig.h b/lang/qt/src/qgpgmenewcryptoconfig.h index 15579fd7..7bdf5d3a 100644 --- a/lang/qt/src/qgpgmenewcryptoconfig.h +++ b/lang/qt/src/qgpgmenewcryptoconfig.h @@ -1,193 +1,193 @@ /* qgpgmenewcryptoconfig.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2010 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef QGPGME_QGPGMENEWCRYPTOCONFIG_H #define QGPGME_QGPGMENEWCRYPTOCONFIG_H #include "qgpgme_export.h" #include "cryptoconfig.h" #include #include #include #ifdef BUILDING_QGPGME # include "configuration.h" #else # include #endif #include #include class QGpgMENewCryptoConfig; class QGpgMENewCryptoConfigComponent; class QGpgMENewCryptoConfigGroup; class QGpgMENewCryptoConfigEntry; class QGpgMENewCryptoConfigEntry : public QGpgME::CryptoConfigEntry { public: QGpgMENewCryptoConfigEntry(const std::shared_ptr &group, const GpgME::Configuration::Option &option); ~QGpgMENewCryptoConfigEntry(); - QString name() const Q_DECL_OVERRIDE; - QString description() const Q_DECL_OVERRIDE; - QString path() const Q_DECL_OVERRIDE; - bool isOptional() const Q_DECL_OVERRIDE; - bool isReadOnly() const Q_DECL_OVERRIDE; - bool isList() const Q_DECL_OVERRIDE; - bool isRuntime() const Q_DECL_OVERRIDE; - Level level() const Q_DECL_OVERRIDE; - ArgType argType() const Q_DECL_OVERRIDE; - bool isSet() const Q_DECL_OVERRIDE; - bool boolValue() const Q_DECL_OVERRIDE; - QString stringValue() const Q_DECL_OVERRIDE; - int intValue() const Q_DECL_OVERRIDE; - unsigned int uintValue() const Q_DECL_OVERRIDE; - QUrl urlValue() const Q_DECL_OVERRIDE; - unsigned int numberOfTimesSet() const Q_DECL_OVERRIDE; - std::vector intValueList() const Q_DECL_OVERRIDE; - std::vector uintValueList() const Q_DECL_OVERRIDE; - QList urlValueList() const Q_DECL_OVERRIDE; - void resetToDefault() Q_DECL_OVERRIDE; - void setBoolValue(bool) Q_DECL_OVERRIDE; - void setStringValue(const QString &) Q_DECL_OVERRIDE; - void setIntValue(int) Q_DECL_OVERRIDE; - void setUIntValue(unsigned int) Q_DECL_OVERRIDE; - void setURLValue(const QUrl &) Q_DECL_OVERRIDE; - void setNumberOfTimesSet(unsigned int) Q_DECL_OVERRIDE; - void setIntValueList(const std::vector &) Q_DECL_OVERRIDE; - void setUIntValueList(const std::vector &) Q_DECL_OVERRIDE; - void setURLValueList(const QList &) Q_DECL_OVERRIDE; - bool isDirty() const Q_DECL_OVERRIDE; + QString name() const override; + QString description() const override; + QString path() const override; + bool isOptional() const override; + bool isReadOnly() const override; + bool isList() const override; + bool isRuntime() const override; + Level level() const override; + ArgType argType() const override; + bool isSet() const override; + bool boolValue() const override; + QString stringValue() const override; + int intValue() const override; + unsigned int uintValue() const override; + QUrl urlValue() const override; + unsigned int numberOfTimesSet() const override; + std::vector intValueList() const override; + std::vector uintValueList() const override; + QList urlValueList() const override; + void resetToDefault() override; + void setBoolValue(bool) override; + void setStringValue(const QString &) override; + void setIntValue(int) override; + void setUIntValue(unsigned int) override; + void setURLValue(const QUrl &) override; + void setNumberOfTimesSet(unsigned int) override; + void setIntValueList(const std::vector &) override; + void setUIntValueList(const std::vector &) override; + void setURLValueList(const QList &) override; + bool isDirty() const override; QStringList stringValueList() const; QVariant defaultValue() const; #if 0 void setDirty(bool b); QString outputString() const; protected: bool isStringType() const; QVariant stringToValue(const QString &value, bool unescape) const; QString toString(bool escape) const; #endif private: std::weak_ptr m_group; GpgME::Configuration::Option m_option; }; class QGpgMENewCryptoConfigGroup : public QGpgME::CryptoConfigGroup { public: QGpgMENewCryptoConfigGroup(const std::shared_ptr &parent, const GpgME::Configuration::Option &option); ~QGpgMENewCryptoConfigGroup(); - QString name() const Q_DECL_OVERRIDE; - QString iconName() const Q_DECL_OVERRIDE + QString name() const override; + QString iconName() const override { return QString(); } - QString description() const Q_DECL_OVERRIDE; - QString path() const Q_DECL_OVERRIDE; - QGpgME::CryptoConfigEntry::Level level() const Q_DECL_OVERRIDE; - QStringList entryList() const Q_DECL_OVERRIDE; - QGpgMENewCryptoConfigEntry *entry(const QString &name) const Q_DECL_OVERRIDE; + QString description() const override; + QString path() const override; + QGpgME::CryptoConfigEntry::Level level() const override; + QStringList entryList() const override; + QGpgMENewCryptoConfigEntry *entry(const QString &name) const override; private: friend class QGpgMENewCryptoConfigComponent; // it adds the entries std::weak_ptr m_component; GpgME::Configuration::Option m_option; QStringList m_entryNames; QHash< QString, std::shared_ptr > m_entriesByName; }; /// For docu, see kleo/cryptoconfig.h class QGpgMENewCryptoConfigComponent : public QGpgME::CryptoConfigComponent, public std::enable_shared_from_this { public: QGpgMENewCryptoConfigComponent(); ~QGpgMENewCryptoConfigComponent(); void setComponent(const GpgME::Configuration::Component &component); - QString name() const Q_DECL_OVERRIDE; - QString iconName() const Q_DECL_OVERRIDE + QString name() const override; + QString iconName() const override { return name(); } - QString description() const Q_DECL_OVERRIDE; - QStringList groupList() const Q_DECL_OVERRIDE; - QGpgMENewCryptoConfigGroup *group(const QString &name) const Q_DECL_OVERRIDE; + QString description() const override; + QStringList groupList() const override; + QGpgMENewCryptoConfigGroup *group(const QString &name) const override; void sync(bool runtime); private: GpgME::Configuration::Component m_component; QHash< QString, std::shared_ptr > m_groupsByName; }; /** * CryptoConfig implementation around the gpgconf command-line tool * For method docu, see kleo/cryptoconfig.h */ class QGPGME_EXPORT QGpgMENewCryptoConfig : public QGpgME::CryptoConfig { public: /** * Constructor */ QGpgMENewCryptoConfig(); ~QGpgMENewCryptoConfig(); - QStringList componentList() const Q_DECL_OVERRIDE; + QStringList componentList() const override; - QGpgMENewCryptoConfigComponent *component(const QString &name) const Q_DECL_OVERRIDE; + QGpgMENewCryptoConfigComponent *component(const QString &name) const override; - void clear() Q_DECL_OVERRIDE; - void sync(bool runtime) Q_DECL_OVERRIDE; + void clear() override; + void sync(bool runtime) override; private: /// @param showErrors if true, a messagebox will be shown if e.g. gpgconf wasn't found void reloadConfiguration(bool showErrors); private: QHash< QString, std::shared_ptr > m_componentsByName; bool m_parsed; }; #endif /* QGPGME_QGPGMENEWCRYPTOCONFIG_H */ diff --git a/lang/qt/src/qgpgmequickjob.h b/lang/qt/src/qgpgmequickjob.h index b4e2dfa9..2f59d8d4 100644 --- a/lang/qt/src/qgpgmequickjob.h +++ b/lang/qt/src/qgpgmequickjob.h @@ -1,77 +1,77 @@ /* qgpgmequickjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2017 Intevation GmbH Copyright (c) 2020 g10 Code GmbH Software engineering by Ingo Klöcker QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef QGPGME_QGPGMEQUICKJOB_H #define QGPGME_QGPGMEQUICKJOB_H #include "quickjob.h" #include "threadedjobmixin.h" namespace QGpgME { /** * Interface to the modern key manipulation functions. */ class QGpgMEQuickJob #ifdef Q_MOC_RUN : public QuickJob #else : public _detail::ThreadedJobMixin #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEQuickJob(GpgME::Context *context); ~QGpgMEQuickJob(); void startCreate(const QString &uid, const char *algo, const QDateTime &expires = QDateTime(), const GpgME::Key &key = GpgME::Key(), - unsigned int flags = 0) Q_DECL_OVERRIDE; - void startAddUid(const GpgME::Key &key, const QString &uid) Q_DECL_OVERRIDE; - void startRevUid(const GpgME::Key &key, const QString &uid) Q_DECL_OVERRIDE; + unsigned int flags = 0) override; + void startAddUid(const GpgME::Key &key, const QString &uid) override; + void startRevUid(const GpgME::Key &key, const QString &uid) override; void startAddSubkey(const GpgME::Key &key, const char *algo, const QDateTime &expires = QDateTime(), - unsigned int flags = 0) Q_DECL_OVERRIDE; + unsigned int flags = 0) override; void startRevokeSignature(const GpgME::Key &key, const GpgME::Key &signingKey, - const std::vector &userIds = std::vector()) Q_DECL_OVERRIDE; + const std::vector &userIds = std::vector()) override; }; } #endif diff --git a/lang/qt/src/qgpgmerefreshsmimekeysjob.h b/lang/qt/src/qgpgmerefreshsmimekeysjob.h index b5b70e99..b75bb0e2 100644 --- a/lang/qt/src/qgpgmerefreshsmimekeysjob.h +++ b/lang/qt/src/qgpgmerefreshsmimekeysjob.h @@ -1,81 +1,81 @@ /* qgpgmerefreshsmimekeysjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__ #define __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__ #include "refreshkeysjob.h" #ifdef BUILDING_QGPGME # include "context.h" #else #include "gpgme++/context.h" #endif #include #include namespace QGpgME { class QGpgMERefreshSMIMEKeysJob : public RefreshKeysJob { Q_OBJECT public: QGpgMERefreshSMIMEKeysJob(); ~QGpgMERefreshSMIMEKeysJob(); /* from RefreshKeysJob */ - GpgME::Error start(const QStringList &patterns) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &patterns) override; GpgME::Error start(const std::vector &keys) override; private Q_SLOTS: /* from Job */ - void slotCancel() Q_DECL_OVERRIDE; + void slotCancel() override; void slotStatus(QProcess *, const QString &, const QStringList &); void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus); private: GpgME::Error startAProcess(); private: QProcess *mProcess; GpgME::Error mError; QStringList mPatternsToDo; }; } #endif // __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__ diff --git a/lang/qt/src/qgpgmesignencryptjob.h b/lang/qt/src/qgpgmesignencryptjob.h index 789e69c7..cf6053b5 100644 --- a/lang/qt/src/qgpgmesignencryptjob.h +++ b/lang/qt/src/qgpgmesignencryptjob.h @@ -1,122 +1,122 @@ /* qgpgmesignencryptjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMESIGNENCRYPTJOB_H__ #define __QGPGME_QGPGMESIGNENCRYPTJOB_H__ #include "signencryptjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "signingresult.h" #else #include #endif #ifdef BUILDING_QGPGME # include "encryptionresult.h" #else #include #endif #ifdef BUILDING_QGPGME # include "key.h" #else #include #endif #include namespace QGpgME { class QGpgMESignEncryptJob #ifdef Q_MOC_RUN : public SignEncryptJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMESignEncryptJob(GpgME::Context *context); ~QGpgMESignEncryptJob(); /* from SignEncryptJob */ GpgME::Error start(const std::vector &signers, const std::vector &recipients, - const QByteArray &plainText, bool alwaysTrust) Q_DECL_OVERRIDE; + const QByteArray &plainText, bool alwaysTrust) override; /* from SignEncryptJob */ void start(const std::vector &signers, const std::vector &recipients, const std::shared_ptr &plainText, const std::shared_ptr &cipherText, - bool alwaysTrust) Q_DECL_OVERRIDE; + bool alwaysTrust) override; void start(const std::vector &signers, const std::vector &recipients, const std::shared_ptr &plainText, const std::shared_ptr &cipherText, - const GpgME::Context::EncryptionFlags flags) Q_DECL_OVERRIDE; + const GpgME::Context::EncryptionFlags flags) override; std::pair exec(const std::vector &signers, const std::vector &recipients, const QByteArray &plainText, bool alwaysTrust, - QByteArray &cipherText) Q_DECL_OVERRIDE; + QByteArray &cipherText) override; std::pair exec(const std::vector &signers, const std::vector &recipients, const QByteArray &plainText, const GpgME::Context::EncryptionFlags flags, - QByteArray &cipherText) Q_DECL_OVERRIDE; + QByteArray &cipherText) override; /* from SignEncryptJob */ - void setOutputIsBase64Encoded(bool on) Q_DECL_OVERRIDE; + void setOutputIsBase64Encoded(bool on) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: bool mOutputIsBase64Encoded; std::pair mResult; }; } #endif // __QGPGME_QGPGMESIGNENCRYPTJOB_H__ diff --git a/lang/qt/src/qgpgmesignjob.h b/lang/qt/src/qgpgmesignjob.h index c6203a18..d4d2577e 100644 --- a/lang/qt/src/qgpgmesignjob.h +++ b/lang/qt/src/qgpgmesignjob.h @@ -1,102 +1,102 @@ /* qgpgmesignjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMESIGNJOB_H__ #define __QGPGME_QGPGMESIGNJOB_H__ #include "signjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "signingresult.h" #else #include #endif #ifdef BUILDING_QGPGME # include "key.h" #else #include #endif namespace QGpgME { class QGpgMESignJob #ifdef Q_MOC_RUN : public SignJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMESignJob(GpgME::Context *context); ~QGpgMESignJob(); /* from SignJob */ GpgME::Error start(const std::vector &signers, const QByteArray &plainText, - GpgME::SignatureMode mode) Q_DECL_OVERRIDE; + GpgME::SignatureMode mode) override; /* from SignJob */ void start(const std::vector &signers, const std::shared_ptr &plainText, const std::shared_ptr &signature, - GpgME::SignatureMode mode) Q_DECL_OVERRIDE; + GpgME::SignatureMode mode) override; /* from SignJob */ GpgME::SigningResult exec(const std::vector &signers, const QByteArray &plainText, GpgME::SignatureMode mode, - QByteArray &signature) Q_DECL_OVERRIDE; + QByteArray &signature) override; /* from SignJob */ - void setOutputIsBase64Encoded(bool on) Q_DECL_OVERRIDE; + void setOutputIsBase64Encoded(bool on) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::SigningResult mResult; bool mOutputIsBase64Encoded; }; } #endif // __QGPGME_QGPGMESIGNJOB_H__ diff --git a/lang/qt/src/qgpgmesignkeyjob.h b/lang/qt/src/qgpgmesignkeyjob.h index 2ea9e94c..0316beb6 100644 --- a/lang/qt/src/qgpgmesignkeyjob.h +++ b/lang/qt/src/qgpgmesignkeyjob.h @@ -1,98 +1,98 @@ /* qgpgmesignkeyjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMESIGNKEYJOB_H__ #define __QGPGME_QGPGMESIGNKEYJOB_H__ #include "signkeyjob.h" #include "threadedjobmixin.h" #include namespace QGpgME { class QGpgMESignKeyJob #ifdef Q_MOC_RUN : public SignKeyJob #else : public _detail::ThreadedJobMixin #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMESignKeyJob(GpgME::Context *context); ~QGpgMESignKeyJob(); /* from SignKeyJob */ - GpgME::Error start(const GpgME::Key &key) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key) override; /* from SignKeyJob */ - void setUserIDsToSign(const std::vector &idsToSign) Q_DECL_OVERRIDE; + void setUserIDsToSign(const std::vector &idsToSign) override; /* from SignKeyJob */ - void setCheckLevel(unsigned int checkLevel) Q_DECL_OVERRIDE; + void setCheckLevel(unsigned int checkLevel) override; /* from SignKeyJob */ - void setExportable(bool exportable) Q_DECL_OVERRIDE; + void setExportable(bool exportable) override; /* from SignKeyJob */ - void setSigningKey(const GpgME::Key &key) Q_DECL_OVERRIDE; + void setSigningKey(const GpgME::Key &key) override; /* from SignKeyJob */ - void setNonRevocable(bool nonRevocable) Q_DECL_OVERRIDE; + void setNonRevocable(bool nonRevocable) override; /* from SignKeyJob */ - void setRemark(const QString &remark) Q_DECL_OVERRIDE; + void setRemark(const QString &remark) override; /* from SignKeyJob */ - void setDupeOk(bool value) Q_DECL_OVERRIDE; + void setDupeOk(bool value) override; /* from SignKeyJob */ - void setTrustSignature(GpgME::TrustSignatureTrust trust, unsigned short depth, const QString &scope) Q_DECL_OVERRIDE; + void setTrustSignature(GpgME::TrustSignatureTrust trust, unsigned short depth, const QString &scope) override; void setExpirationDate(const QDate &expiration) override; private: class Private; std::unique_ptr d; }; } #endif // __QGPGME_QGPGMESIGNKEYJOB_H__ diff --git a/lang/qt/src/qgpgmetofupolicyjob.h b/lang/qt/src/qgpgmetofupolicyjob.h index 482a8fd9..ad09045d 100644 --- a/lang/qt/src/qgpgmetofupolicyjob.h +++ b/lang/qt/src/qgpgmetofupolicyjob.h @@ -1,66 +1,66 @@ /* qgpgmetofupolicyjob.h Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef QGPGME_QGPGMETOFUPOLICYJOB_H #define QGPGME_QGPGMETOFUPOLICYJOB_H #include "tofupolicyjob.h" #include "threadedjobmixin.h" namespace GpgME { class Key; } // namespace GpgME namespace QGpgME { class QGpgMETofuPolicyJob #ifdef Q_MOC_RUN : public TofuPolicyJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMETofuPolicyJob(GpgME::Context *context); ~QGpgMETofuPolicyJob(); - void start(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) Q_DECL_OVERRIDE; - GpgME::Error exec(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) Q_DECL_OVERRIDE; + void start(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) override; + GpgME::Error exec(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) override; }; } #endif diff --git a/lang/qt/src/qgpgmeverifydetachedjob.h b/lang/qt/src/qgpgmeverifydetachedjob.h index 81c49f3e..49161396 100644 --- a/lang/qt/src/qgpgmeverifydetachedjob.h +++ b/lang/qt/src/qgpgmeverifydetachedjob.h @@ -1,86 +1,86 @@ /* qgpgmeverifydetachedjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEVERIFYDETACHEDJOB_H__ #define __QGPGME_QGPGMEVERIFYDETACHEDJOB_H__ #include "verifydetachedjob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "verificationresult.h" #else #include #endif namespace QGpgME { class QGpgMEVerifyDetachedJob #ifdef Q_MOC_RUN : public VerifyDetachedJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEVerifyDetachedJob(GpgME::Context *context); ~QGpgMEVerifyDetachedJob(); /* from VerifyDetachedJob */ - GpgME::Error start(const QByteArray &signature, const QByteArray &signedData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &signature, const QByteArray &signedData) override; /* from VerifyDetachedJob */ - void start(const std::shared_ptr &signature, const std::shared_ptr &signedData) Q_DECL_OVERRIDE; + void start(const std::shared_ptr &signature, const std::shared_ptr &signedData) override; /* from VerifyDetachedJob */ GpgME::VerificationResult exec(const QByteArray &signature, - const QByteArray &signedData) Q_DECL_OVERRIDE; + const QByteArray &signedData) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::VerificationResult mResult; }; } #endif // __QGPGME_QGPGMEVERIFYDETACHEDJOB_H__ diff --git a/lang/qt/src/qgpgmeverifyopaquejob.h b/lang/qt/src/qgpgmeverifyopaquejob.h index 3ba05098..ae51227c 100644 --- a/lang/qt/src/qgpgmeverifyopaquejob.h +++ b/lang/qt/src/qgpgmeverifyopaquejob.h @@ -1,85 +1,85 @@ /* qgpgmeverifyopaquejob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEVERIFYOPAQUEJOB_H__ #define __QGPGME_QGPGMEVERIFYOPAQUEJOB_H__ #include "verifyopaquejob.h" #include "threadedjobmixin.h" #ifdef BUILDING_QGPGME # include "verificationresult.h" #else #include #endif namespace QGpgME { class QGpgMEVerifyOpaqueJob #ifdef Q_MOC_RUN : public VerifyOpaqueJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEVerifyOpaqueJob(GpgME::Context *context); ~QGpgMEVerifyOpaqueJob(); /* from VerifyOpaqueJob */ - GpgME::Error start(const QByteArray &signedData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &signedData) override; /* from VerifyOpaqueJob */ - void start(const std::shared_ptr &signedData, const std::shared_ptr &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr &signedData, const std::shared_ptr &plainText) override; /* form VerifyOpaqueJob */ - GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainData) Q_DECL_OVERRIDE; + GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainData) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::VerificationResult mResult; }; } #endif // __QGPGME_QGPGMEVERIFYOPAQUEJOB_H__ diff --git a/lang/qt/src/qgpgmewkdlookupjob.h b/lang/qt/src/qgpgmewkdlookupjob.h index 61f9465c..9a206d25 100644 --- a/lang/qt/src/qgpgmewkdlookupjob.h +++ b/lang/qt/src/qgpgmewkdlookupjob.h @@ -1,70 +1,70 @@ /* qgpgmewkdlookupjob.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2021 g10 Code GmbH Software engineering by Ingo Klöcker QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_QGPGMEWKDLOOKUPJOB_H__ #define __QGPGME_QGPGMEWKDLOOKUPJOB_H__ #include "threadedjobmixin.h" #include "wkdlookupjob.h" #include "wkdlookupresult.h" namespace QGpgME { class WKDLookupResult; class QGpgMEWKDLookupJob #ifdef Q_MOC_RUN : public WKDLookupJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEWKDLookupJob(GpgME::Context *context); ~QGpgMEWKDLookupJob(); /* from WKDLookupJob */ - GpgME::Error start(const QString &email) Q_DECL_OVERRIDE; + GpgME::Error start(const QString &email) override; /* from WKDLookupJob */ - WKDLookupResult exec(const QString &email) Q_DECL_OVERRIDE; + WKDLookupResult exec(const QString &email) override; }; } #endif // __QGPGME_QGPGMEWKDLOOKUPJOB_H__ diff --git a/lang/qt/src/qgpgmewkspublishjob.h b/lang/qt/src/qgpgmewkspublishjob.h index 211cefb6..a8635e16 100644 --- a/lang/qt/src/qgpgmewkspublishjob.h +++ b/lang/qt/src/qgpgmewkspublishjob.h @@ -1,71 +1,71 @@ /* qgpgmewkspublishjob.h Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef QGPGME_QGPGMEWKSPUBLISHJOB_H #define QGPGME_QGPGMEWKSPUBLISHJOB_H #include "wkspublishjob.h" #include "threadedjobmixin.h" namespace GpgME { class Key; } // namespace GpgME namespace QGpgME { /** * Handles Web Key Service Publishing. Needs WKS tools installed and * server support. */ class QGpgMEWKSPublishJob #ifdef Q_MOC_RUN : public WKSPublishJob #else : public _detail::ThreadedJobMixin > #endif { Q_OBJECT #ifdef Q_MOC_RUN public Q_SLOTS: void slotFinished(); #endif public: explicit QGpgMEWKSPublishJob(GpgME::Context *context); ~QGpgMEWKSPublishJob(); - void startCheck(const QString &mailbox) Q_DECL_OVERRIDE; - void startCreate(const char *fpr, const QString &mailbox) Q_DECL_OVERRIDE; - void startReceive(const QByteArray &response) Q_DECL_OVERRIDE; + void startCheck(const QString &mailbox) override; + void startCreate(const char *fpr, const QString &mailbox) override; + void startReceive(const QByteArray &response) override; }; } #endif diff --git a/lang/qt/src/threadedjobmixin.h b/lang/qt/src/threadedjobmixin.h index f50ac43d..afabae3b 100644 --- a/lang/qt/src/threadedjobmixin.h +++ b/lang/qt/src/threadedjobmixin.h @@ -1,300 +1,300 @@ /* threadedjobmixin.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __QGPGME_THREADEDJOBMIXING_H__ #define __QGPGME_THREADEDJOBMIXING_H__ #include #include #include #include #include #ifdef BUILDING_QGPGME # include "context.h" # include "interfaces/progressprovider.h" #else # include # include #endif #include "job.h" #include #include namespace QGpgME { namespace _detail { QString audit_log_as_html(GpgME::Context *ctx, GpgME::Error &err); class PatternConverter { const QList m_list; mutable const char **m_patterns; public: explicit PatternConverter(const QByteArray &ba); explicit PatternConverter(const QString &s); explicit PatternConverter(const QList &lba); explicit PatternConverter(const QStringList &sl); ~PatternConverter(); const char **patterns() const; }; class ToThreadMover { QObject *const m_object; QThread *const m_thread; public: ToThreadMover(QObject *o, QThread *t) : m_object(o), m_thread(t) {} ToThreadMover(QObject &o, QThread *t) : m_object(&o), m_thread(t) {} ToThreadMover(const std::shared_ptr &o, QThread *t) : m_object(o.get()), m_thread(t) {} ~ToThreadMover() { if (m_object && m_thread) { m_object->moveToThread(m_thread); } } }; template class Thread : public QThread { public: explicit Thread(QObject *parent = Q_NULLPTR) : QThread(parent) {} void setFunction(const std::function &function) { const QMutexLocker locker(&m_mutex); m_function = function; } bool hasFunction() { const QMutexLocker locker(&m_mutex); return static_cast(m_function); } T_result result() const { const QMutexLocker locker(&m_mutex); return m_result; } private: - void run() Q_DECL_OVERRIDE { + void run() override { const QMutexLocker locker(&m_mutex); m_result = m_function(); } private: mutable QMutex m_mutex; std::function m_function; T_result m_result; }; template > class ThreadedJobMixin : public T_base, public GpgME::ProgressProvider { public: typedef ThreadedJobMixin mixin_type; typedef T_result result_type; void run() { Q_ASSERT(m_thread.hasFunction() && "Call setWorkerFunction() before run()"); m_thread.start(); } protected: static_assert(std::tuple_size::value > 2, "Result tuple too small"); static_assert(std::is_same < typename std::tuple_element < std::tuple_size::value - 2, T_result >::type, QString >::value, "Second to last result type not a QString"); static_assert(std::is_same < typename std::tuple_element < std::tuple_size::value - 1, T_result >::type, GpgME::Error >::value, "Last result type not a GpgME::Error"); explicit ThreadedJobMixin(GpgME::Context *ctx) : T_base(nullptr), m_ctx(ctx), m_thread(), m_auditLog(), m_auditLogError() { } void lateInitialization() { assert(m_ctx); QObject::connect(&m_thread, &QThread::finished, this, &mixin_type::slotFinished); m_ctx->setProgressProvider(this); QGpgME::g_context_map.insert(this, m_ctx.get()); } ~ThreadedJobMixin() { QGpgME::g_context_map.remove(this); } template void setWorkerFunction(const T_binder &func) { m_thread.setFunction([this, func]() { return func(this->context()); }); } template void run(const T_binder &func) { m_thread.setFunction(std::bind(func, this->context())); m_thread.start(); } template void run(const T_binder &func, const std::shared_ptr &io) { if (io) { io->moveToThread(&m_thread); } // the arguments passed here to the functor are stored in a QThread, and are not // necessarily destroyed (living outside the UI thread) at the time the result signal // is emitted and the signal receiver wants to clean up IO devices. // To avoid such races, we pass std::weak_ptr's to the functor. m_thread.setFunction(std::bind(func, this->context(), this->thread(), std::weak_ptr(io))); m_thread.start(); } template void run(const T_binder &func, const std::shared_ptr &io1, const std::shared_ptr &io2) { if (io1) { io1->moveToThread(&m_thread); } if (io2) { io2->moveToThread(&m_thread); } // the arguments passed here to the functor are stored in a QThread, and are not // necessarily destroyed (living outside the UI thread) at the time the result signal // is emitted and the signal receiver wants to clean up IO devices. // To avoid such races, we pass std::weak_ptr's to the functor. m_thread.setFunction(std::bind(func, this->context(), this->thread(), std::weak_ptr(io1), std::weak_ptr(io2))); m_thread.start(); } GpgME::Context *context() const { return m_ctx.get(); } virtual void resultHook(const result_type &) {} void slotFinished() { const T_result r = m_thread.result(); m_auditLog = std::get < std::tuple_size::value - 2 > (r); m_auditLogError = std::get < std::tuple_size::value - 1 > (r); resultHook(r); Q_EMIT this->done(); doEmitResult(r); this->deleteLater(); } - void slotCancel() Q_DECL_OVERRIDE { + void slotCancel() override { if (m_ctx) { m_ctx->cancelPendingOperation(); } } - QString auditLogAsHtml() const Q_DECL_OVERRIDE + QString auditLogAsHtml() const override { return m_auditLog; } - GpgME::Error auditLogError() const Q_DECL_OVERRIDE + GpgME::Error auditLogError() const override { return m_auditLogError; } void showProgress(const char * /*what*/, - int /*type*/, int current, int total) Q_DECL_OVERRIDE { + int /*type*/, int current, int total) override { // will be called from the thread exec'ing the operation, so // just bounce everything to the owning thread: // ### hope this is thread-safe (meta obj is const, and // ### portEvent is thread-safe, so should be ok) QMetaObject::invokeMethod(this, "progress", Qt::QueuedConnection, // TODO port Q_ARG(QString, QString()), Q_ARG(int, current), Q_ARG(int, total)); } private: template void doEmitResult(const std::tuple &tuple) { Q_EMIT this->result(std::get<0>(tuple), std::get<1>(tuple)); } template void doEmitResult(const std::tuple &tuple) { Q_EMIT this->result(std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple)); } template void doEmitResult(const std::tuple &tuple) { Q_EMIT this->result(std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple)); } template void doEmitResult(const std::tuple &tuple) { Q_EMIT this->result(std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple)); } private: std::shared_ptr m_ctx; Thread m_thread; QString m_auditLog; GpgME::Error m_auditLogError; }; } } #endif /* __QGPGME_THREADEDJOBMIXING_H__ */ diff --git a/lang/qt/tests/t-support.h b/lang/qt/tests/t-support.h index ecafe2f4..fd7be44a 100644 --- a/lang/qt/tests/t-support.h +++ b/lang/qt/tests/t-support.h @@ -1,134 +1,134 @@ /* t-support.h This file is part of qgpgme, the Qt API binding for gpgme Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. QGpgME is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef T_SUPPORT_H #define T_SUPPORT_H #include "interfaces/passphraseprovider.h" #include #include #include namespace GpgME { class Context; } namespace QGpgME { class Job; } /// generic variant of QVERIFY returning \a returnValue on failure #define VERIFY_OR_RETURN_VALUE(statement, returnValue) \ do {\ if (!QTest::qVerify(static_cast(statement), #statement, "", __FILE__, __LINE__))\ return returnValue;\ } while (false) /// generic variant of QCOMPARE returning \a returnValue on failure #define COMPARE_OR_RETURN_VALUE(actual, expected, returnValue) \ do {\ if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ return returnValue;\ } while (false) /// variant of QVERIFY returning a default constructed object on failure #define VERIFY_OR_OBJECT(statement) VERIFY_OR_RETURN_VALUE(statement, {}) /// variant of QCOMPARE returning a default constructed object on failure #define COMPARE_OR_OBJECT(actual, expected) COMPARE_OR_RETURN_VALUE(actual, expected, {}) /// variant of QVERIFY returning \c false on failure #define VERIFY_OR_FALSE(statement) VERIFY_OR_RETURN_VALUE(statement, false) /// variant of QCOMPARE returning \c false on failure #define COMPARE_OR_FALSE(actual, expected) COMPARE_OR_RETURN_VALUE(actual, expected, false) namespace QTest { template <> inline char *toString(const std::string &s) { return QTest::toString(s.c_str()); } } namespace GpgME { class TestPassphraseProvider : public PassphraseProvider { public: char *getPassphrase(const char * /*useridHint*/, const char * /*description*/, - bool /*previousWasBad*/, bool &/*canceled*/) Q_DECL_OVERRIDE + bool /*previousWasBad*/, bool &/*canceled*/) override { char *ret; gpgrt_asprintf(&ret, "abc"); return ret; } }; } // namespace GpgME void killAgent(const QString &dir = qgetenv("GNUPGHOME")); /* Is the passphrase Provider / loopback Supported */ bool loopbackSupported(); class QGpgMETest : public QObject { Q_OBJECT Q_SIGNALS: void asyncDone(); protected: static bool doOnlineTests(); bool copyKeyrings(const QString &from, const QString& to); bool importSecretKeys(const char *keyData, int expectedKeys = 1); void hookUpPassphraseProvider(GpgME::Context *context); void hookUpPassphraseProvider(QGpgME::Job *job); public Q_SLOTS: void initTestCase(); void cleanupTestCase(); private: GpgME::TestPassphraseProvider mPassphraseProvider; }; /* Timeout, in milliseconds, for use with QSignalSpy to wait on signals. */ #define QSIGNALSPY_TIMEOUT 60000 #endif // T_SUPPORT_H