diff options
author | Andre Heinecke <[email protected]> | 2016-04-11 15:15:16 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2016-04-11 15:15:16 +0000 |
commit | afd8fad6e275e2f74b2ad045dce05d826986e2ec (patch) | |
tree | 624b6e9097a2c4c3e06ab9e25b5f4efcfafbf96f | |
parent | Qt: Remove predicates.h and stl_util.h (diff) | |
download | gpgme-afd8fad6e275e2f74b2ad045dce05d826986e2ec.tar.gz gpgme-afd8fad6e275e2f74b2ad045dce05d826986e2ec.zip |
Qt: Remove remaining boost usage
* lang/qt/src/dataprovider.h,
lang/qt/src/decryptjob.h,
lang/qt/src/decryptverifyjob.h,
lang/qt/src/encryptjob.h,
lang/qt/src/qgpgmeadduseridjob.cpp,
lang/qt/src/qgpgmechangeexpiryjob.cpp,
lang/qt/src/qgpgmechangeownertrustjob.cpp,
lang/qt/src/qgpgmechangepasswdjob.cpp,
lang/qt/src/qgpgmedecryptjob.cpp,
lang/qt/src/qgpgmedecryptverifyjob.cpp,
lang/qt/src/qgpgmedeletejob.cpp,
lang/qt/src/qgpgmedownloadjob.cpp,
lang/qt/src/qgpgmeencryptjob.cpp,
lang/qt/src/qgpgmeexportjob.cpp,
lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
lang/qt/src/qgpgmeimportjob.cpp,
lang/qt/src/qgpgmekeygenerationjob.cpp,
lang/qt/src/qgpgmekeylistjob.cpp,
lang/qt/src/qgpgmenewcryptoconfig.cpp,
lang/qt/src/qgpgmenewcryptoconfig.h,
lang/qt/src/qgpgmesignencryptjob.cpp,
lang/qt/src/qgpgmesignjob.cpp,
lang/qt/src/qgpgmesignkeyjob.cpp,
lang/qt/src/qgpgmeverifydetachedjob.cpp,
lang/qt/src/qgpgmeverifyopaquejob.cpp,
lang/qt/src/signencryptjob.h,
lang/qt/src/signjob.h,
lang/qt/src/threadedjobmixin.cpp,
lang/qt/src/threadedjobmixin.h,
lang/qt/src/verifydetachedjob.h,
lang/qt/src/verifyopaquejob.h: Remove boost usage.
--
Mostly done with search and replace.
31 files changed, 81 insertions, 121 deletions
diff --git a/lang/qt/src/dataprovider.h b/lang/qt/src/dataprovider.h index 165e4f4a..672980a8 100644 --- a/lang/qt/src/dataprovider.h +++ b/lang/qt/src/dataprovider.h @@ -25,10 +25,10 @@ #include "qgpgme_export.h" #include <interfaces/dataprovider.h> +#include <memory> #include <QtCore/QByteArray> -#include <boost/shared_ptr.hpp> class QIODevice; diff --git a/lang/qt/src/decryptjob.h b/lang/qt/src/decryptjob.h index 04c603a4..2aa4661c 100644 --- a/lang/qt/src/decryptjob.h +++ b/lang/qt/src/decryptjob.h @@ -36,7 +36,7 @@ #include "job.h" -#include <boost/shared_ptr.hpp> +#include <memory> class QByteArray; class QIODevice; diff --git a/lang/qt/src/decryptverifyjob.h b/lang/qt/src/decryptverifyjob.h index fa0d1d22..501df83c 100644 --- a/lang/qt/src/decryptverifyjob.h +++ b/lang/qt/src/decryptverifyjob.h @@ -36,7 +36,7 @@ #include "job.h" -#include <boost/shared_ptr.hpp> +#include <memory> class QByteArray; class QIODevice; diff --git a/lang/qt/src/encryptjob.h b/lang/qt/src/encryptjob.h index 1fd28905..6c4ae5c2 100644 --- a/lang/qt/src/encryptjob.h +++ b/lang/qt/src/encryptjob.h @@ -36,8 +36,7 @@ #include "job.h" -#include <boost/shared_ptr.hpp> - +#include <memory> #include <vector> class QByteArray; diff --git a/lang/qt/src/qgpgmeadduseridjob.cpp b/lang/qt/src/qgpgmeadduseridjob.cpp index 2155675e..b1d5c5c0 100644 --- a/lang/qt/src/qgpgmeadduseridjob.cpp +++ b/lang/qt/src/qgpgmeadduseridjob.cpp @@ -45,7 +45,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEAddUserIDJob::QGpgMEAddUserIDJob(Context *context) : mixin_type(context) @@ -77,7 +76,7 @@ static QGpgMEAddUserIDJob::result_type add_user_id(Context *ctx, const Key &key, Error QGpgMEAddUserIDJob::start(const Key &key, const QString &name, const QString &email, const QString &comment) { - run(bind(&add_user_id, _1, key, name, email, comment)); + run(std::bind(&add_user_id, std::placeholders::_1, key, name, email, comment)); return Error(); } #include "qgpgmeadduseridjob.moc" diff --git a/lang/qt/src/qgpgmechangeexpiryjob.cpp b/lang/qt/src/qgpgmechangeexpiryjob.cpp index d0a93d82..81a49fd1 100644 --- a/lang/qt/src/qgpgmechangeexpiryjob.cpp +++ b/lang/qt/src/qgpgmechangeexpiryjob.cpp @@ -48,7 +48,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEChangeExpiryJob::QGpgMEChangeExpiryJob(Context *context) : mixin_type(context) @@ -76,7 +75,7 @@ static QGpgMEChangeExpiryJob::result_type change_expiry(Context *ctx, const Key Error QGpgMEChangeExpiryJob::start(const Key &key, const QDateTime &expiry) { - run(bind(&change_expiry, _1, key, expiry)); + run(std::bind(&change_expiry, std::placeholders::_1, key, expiry)); return Error(); } #include "qgpgmechangeexpiryjob.moc" diff --git a/lang/qt/src/qgpgmechangeownertrustjob.cpp b/lang/qt/src/qgpgmechangeownertrustjob.cpp index 8d9f00f6..c3220ee1 100644 --- a/lang/qt/src/qgpgmechangeownertrustjob.cpp +++ b/lang/qt/src/qgpgmechangeownertrustjob.cpp @@ -45,7 +45,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEChangeOwnerTrustJob::QGpgMEChangeOwnerTrustJob(Context *context) : mixin_type(context) @@ -72,7 +71,7 @@ static QGpgMEChangeOwnerTrustJob::result_type change_ownertrust(Context *ctx, co Error QGpgMEChangeOwnerTrustJob::start(const Key &key, Key::OwnerTrust trust) { - run(bind(&change_ownertrust, _1, key, trust)); + run(std::bind(&change_ownertrust, std::placeholders::_1, key, trust)); return Error(); } #include "qgpgmechangeownertrustjob.moc" diff --git a/lang/qt/src/qgpgmechangepasswdjob.cpp b/lang/qt/src/qgpgmechangepasswdjob.cpp index eb9937fa..618ed1d5 100644 --- a/lang/qt/src/qgpgmechangepasswdjob.cpp +++ b/lang/qt/src/qgpgmechangepasswdjob.cpp @@ -44,7 +44,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEChangePasswdJob::QGpgMEChangePasswdJob(Context *context) : mixin_type(context) @@ -73,7 +72,7 @@ static QGpgMEChangePasswdJob::result_type change_passwd(Context *ctx, const Key Error QGpgMEChangePasswdJob::start(const Key &key) { - run(bind(&change_passwd, _1, key)); + run(std::bind(&change_passwd, std::placeholders::_1, key)); return Error(); } diff --git a/lang/qt/src/qgpgmedecryptjob.cpp b/lang/qt/src/qgpgmedecryptjob.cpp index 4c2319c0..8233f8d9 100644 --- a/lang/qt/src/qgpgmedecryptjob.cpp +++ b/lang/qt/src/qgpgmedecryptjob.cpp @@ -100,13 +100,13 @@ static QGpgMEDecryptJob::result_type decrypt_qba(Context *ctx, const QByteArray Error QGpgMEDecryptJob::start(const QByteArray &cipherText) { - run(bind(&decrypt_qba, _1, cipherText)); + run(std::bind(&decrypt_qba, std::placeholders::_1, cipherText)); return Error(); } void QGpgMEDecryptJob::start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText) { - run(bind(&decrypt, _1, _2, _3, _4), cipherText, plainText); + run(std::bind(&decrypt, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4), cipherText, plainText); } GpgME::DecryptionResult QGpgME::QGpgMEDecryptJob::exec(const QByteArray &cipherText, diff --git a/lang/qt/src/qgpgmedecryptverifyjob.cpp b/lang/qt/src/qgpgmedecryptverifyjob.cpp index 8c7ef972..8f9026d7 100644 --- a/lang/qt/src/qgpgmedecryptverifyjob.cpp +++ b/lang/qt/src/qgpgmedecryptverifyjob.cpp @@ -108,13 +108,13 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify_qba(Context *ctx, cons Error QGpgMEDecryptVerifyJob::start(const QByteArray &cipherText) { - run(bind(&decrypt_verify_qba, _1, cipherText)); + run(std::bind(&decrypt_verify_qba, std::placeholders::_1, cipherText)); return Error(); } void QGpgMEDecryptVerifyJob::start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText) { - run(bind(&decrypt_verify, _1, _2, _3, _4), cipherText, plainText); + run(std::bind(&decrypt_verify, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4), cipherText, plainText); } std::pair<GpgME::DecryptionResult, GpgME::VerificationResult> diff --git a/lang/qt/src/qgpgmedeletejob.cpp b/lang/qt/src/qgpgmedeletejob.cpp index 4b2f83a3..4de3a172 100644 --- a/lang/qt/src/qgpgmedeletejob.cpp +++ b/lang/qt/src/qgpgmedeletejob.cpp @@ -40,7 +40,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEDeleteJob::QGpgMEDeleteJob(Context *context) : mixin_type(context) @@ -60,7 +59,7 @@ static QGpgMEDeleteJob::result_type delete_key(Context *ctx, const Key &key, boo Error QGpgMEDeleteJob::start(const Key &key, bool allowSecretKeyDeletion) { - run(bind(&delete_key, _1, key, allowSecretKeyDeletion)); + run(std::bind(&delete_key, std::placeholders::_1, key, allowSecretKeyDeletion)); return Error(); } #include "qgpgmedeletejob.moc" diff --git a/lang/qt/src/qgpgmedownloadjob.cpp b/lang/qt/src/qgpgmedownloadjob.cpp index 4f9eea2b..59cf378e 100644 --- a/lang/qt/src/qgpgmedownloadjob.cpp +++ b/lang/qt/src/qgpgmedownloadjob.cpp @@ -88,13 +88,13 @@ static QGpgMEDownloadJob::result_type download(Context *ctx, QThread *thread, co Error QGpgMEDownloadJob::start(const QStringList &pats) { - run(bind(&download_qsl, _1, pats)); + run(std::bind(&download_qsl, std::placeholders::_1, pats)); return Error(); } Error QGpgMEDownloadJob::start(const QByteArray &fpr, const std::shared_ptr<QIODevice> &keyData) { - run(bind(&download, _1, _2, fpr, _3), keyData); + run(std::bind(&download, std::placeholders::_1, std::placeholders::_2, fpr, std::placeholders::_3), keyData); return Error(); } #include "qgpgmedownloadjob.moc" diff --git a/lang/qt/src/qgpgmeencryptjob.cpp b/lang/qt/src/qgpgmeencryptjob.cpp index df8ae7d2..eb4bd449 100644 --- a/lang/qt/src/qgpgmeencryptjob.cpp +++ b/lang/qt/src/qgpgmeencryptjob.cpp @@ -41,13 +41,11 @@ #include <QBuffer> -#include <boost/weak_ptr.hpp> #include <cassert> using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEEncryptJob::QGpgMEEncryptJob(Context *context) : mixin_type(context), @@ -123,16 +121,16 @@ static QGpgMEEncryptJob::result_type encrypt_qba(Context *ctx, const std::vector Error QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust) { - run(boost::bind(&encrypt_qba, _1, recipients, plainText, alwaysTrust, mOutputIsBase64Encoded)); + run(std::bind(&encrypt_qba, std::placeholders::_1, recipients, plainText, alwaysTrust, mOutputIsBase64Encoded)); return Error(); } void QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &cipherText, bool alwaysTrust) { - run(boost::bind(&encrypt, - _1, _2, + run(std::bind(&encrypt, + std::placeholders::_1, std::placeholders::_2, recipients, - _3, _4, + std::placeholders::_3, std::placeholders::_4, alwaysTrust, mOutputIsBase64Encoded), plainText, cipherText); @@ -141,14 +139,14 @@ void QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const std::shar EncryptionResult QGpgMEEncryptJob::exec(const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust, QByteArray &cipherText) { const result_type r = encrypt_qba(context(), recipients, plainText, alwaysTrust, mOutputIsBase64Encoded); - cipherText = get<1>(r); + cipherText = std::get<1>(r); resultHook(r); return mResult; } void QGpgMEEncryptJob::resultHook(const result_type &tuple) { - mResult = get<0>(tuple); + mResult = std::get<0>(tuple); } #if 0 diff --git a/lang/qt/src/qgpgmeexportjob.cpp b/lang/qt/src/qgpgmeexportjob.cpp index 56584faf..dec9817e 100644 --- a/lang/qt/src/qgpgmeexportjob.cpp +++ b/lang/qt/src/qgpgmeexportjob.cpp @@ -45,7 +45,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEExportJob::QGpgMEExportJob(Context *context) : mixin_type(context) @@ -71,7 +70,7 @@ static QGpgMEExportJob::result_type export_qba(Context *ctx, const QStringList & Error QGpgMEExportJob::start(const QStringList &patterns) { - run(bind(&export_qba, _1, patterns)); + run(std::bind(&export_qba, std::placeholders::_1, patterns)); return Error(); } #include "qgpgmeexportjob.moc" diff --git a/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp b/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp index a223aacf..2753b0b3 100644 --- a/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp +++ b/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp @@ -43,7 +43,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEImportFromKeyserverJob::QGpgMEImportFromKeyserverJob(Context *context) : mixin_type(context) @@ -63,7 +62,7 @@ static QGpgMEImportFromKeyserverJob::result_type importfromkeyserver(Context *ct Error QGpgMEImportFromKeyserverJob::start(const std::vector<Key> &keys) { - run(boost::bind(&importfromkeyserver, _1, keys)); + run(std::bind(&importfromkeyserver, std::placeholders::_1, keys)); return Error(); } @@ -78,6 +77,6 @@ GpgME::ImportResult QGpgME::QGpgMEImportFromKeyserverJob::exec(const std::vector void QGpgME::QGpgMEImportFromKeyserverJob::resultHook(const result_type &tuple) { - mResult = get<0>(tuple); + mResult = std::get<0>(tuple); } #include "qgpgmeimportfromkeyserverjob.moc" diff --git a/lang/qt/src/qgpgmeimportjob.cpp b/lang/qt/src/qgpgmeimportjob.cpp index f76fc7d3..891c0f6c 100644 --- a/lang/qt/src/qgpgmeimportjob.cpp +++ b/lang/qt/src/qgpgmeimportjob.cpp @@ -43,7 +43,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEImportJob::QGpgMEImportJob(Context *context) : mixin_type(context) @@ -66,7 +65,7 @@ static QGpgMEImportJob::result_type import_qba(Context *ctx, const QByteArray &c Error QGpgMEImportJob::start(const QByteArray &certData) { - run(bind(&import_qba, _1, certData)); + run(std::bind(&import_qba, std::placeholders::_1, certData)); return Error(); } @@ -81,6 +80,6 @@ GpgME::ImportResult QGpgME::QGpgMEImportJob::exec(const QByteArray &keyData) void QGpgME::QGpgMEImportJob::resultHook(const result_type &tuple) { - mResult = get<0>(tuple); + mResult = std::get<0>(tuple); } #include "qgpgmeimportjob.moc" diff --git a/lang/qt/src/qgpgmekeygenerationjob.cpp b/lang/qt/src/qgpgmekeygenerationjob.cpp index ad2904e2..d286ed59 100644 --- a/lang/qt/src/qgpgmekeygenerationjob.cpp +++ b/lang/qt/src/qgpgmekeygenerationjob.cpp @@ -42,7 +42,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEKeyGenerationJob::QGpgMEKeyGenerationJob(Context *context) : mixin_type(context) @@ -66,7 +65,7 @@ static QGpgMEKeyGenerationJob::result_type generate_key(Context *ctx, const QStr Error QGpgMEKeyGenerationJob::start(const QString ¶meters) { - run(bind(&generate_key, _1, parameters)); + run(std::bind(&generate_key, std::placeholders::_1, parameters)); return Error(); } #include "qgpgmekeygenerationjob.moc" diff --git a/lang/qt/src/qgpgmekeylistjob.cpp b/lang/qt/src/qgpgmekeylistjob.cpp index 61da5be5..a9cc5e18 100644 --- a/lang/qt/src/qgpgmekeylistjob.cpp +++ b/lang/qt/src/qgpgmekeylistjob.cpp @@ -48,7 +48,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEKeyListJob::QGpgMEKeyListJob(Context *context) : mixin_type(context), @@ -132,7 +131,7 @@ retry: Error QGpgMEKeyListJob::start(const QStringList &patterns, bool secretOnly) { mSecretOnly = secretOnly; - run(boost::bind(&list_keys, _1, patterns, secretOnly)); + run(std::bind(&list_keys, std::placeholders::_1, patterns, secretOnly)); return Error(); } @@ -141,14 +140,14 @@ KeyListResult QGpgMEKeyListJob::exec(const QStringList &patterns, bool secretOnl mSecretOnly = secretOnly; const result_type r = list_keys(context(), patterns, secretOnly); resultHook(r); - keys = get<1>(r); - return get<0>(r); + keys = std::get<1>(r); + return std::get<0>(r); } void QGpgMEKeyListJob::resultHook(const result_type &tuple) { - mResult = get<0>(tuple); - Q_FOREACH (const Key &key, get<1>(tuple)) { + mResult = std::get<0>(tuple); + Q_FOREACH (const Key &key, std::get<1>(tuple)) { Q_EMIT nextKey(key); } } diff --git a/lang/qt/src/qgpgmenewcryptoconfig.cpp b/lang/qt/src/qgpgmenewcryptoconfig.cpp index a187360f..965069cd 100644 --- a/lang/qt/src/qgpgmenewcryptoconfig.cpp +++ b/lang/qt/src/qgpgmenewcryptoconfig.cpp @@ -41,15 +41,11 @@ #include "global.h" #include "error.h" -#include <boost/foreach.hpp> -#include <boost/bind.hpp> -#include <boost/mem_fn.hpp> #include <sstream> #include <string> #include <cassert> -using namespace boost; using namespace QGpgME; using namespace GpgME; using namespace GpgME::Configuration; @@ -108,7 +104,7 @@ void QGpgMENewCryptoConfig::reloadConfiguration(bool showErrors) KMessageBox::error(0, wmsg); } #endif - BOOST_FOREACH(const Component & c, components) { + Q_FOREACH(const Component & c, components) { const std::shared_ptr<QGpgMENewCryptoConfigComponent> comp(new QGpgMENewCryptoConfigComponent); comp->setComponent(c); m_componentsByName[ comp->name() ] = comp; @@ -138,7 +134,7 @@ QGpgMENewCryptoConfigComponent *QGpgMENewCryptoConfig::component(const QString & void QGpgMENewCryptoConfig::sync(bool runtime) { - BOOST_FOREACH(const std::shared_ptr<QGpgMENewCryptoConfigComponent> &c, m_componentsByName) + Q_FOREACH(const std::shared_ptr<QGpgMENewCryptoConfigComponent> &c, m_componentsByName) c->sync(runtime); } @@ -167,7 +163,7 @@ void QGpgMENewCryptoConfigComponent::setComponent(const Component &component) std::shared_ptr<QGpgMENewCryptoConfigGroup> group; const std::vector<Option> options = m_component.options(); - BOOST_FOREACH(const Option & o, options) + Q_FOREACH(const Option & o, options) if (o.flags() & Group) { if (group) { m_groupsByName[group->name()] = group; @@ -205,7 +201,7 @@ QStringList QGpgMENewCryptoConfigComponent::groupList() const result.reserve(m_groupsByName.size()); std::transform(m_groupsByName.begin(), m_groupsByName.end(), std::back_inserter(result), - mem_fn(&QGpgMENewCryptoConfigGroup::name)); + std::mem_fn(&QGpgMENewCryptoConfigGroup::name)); return result; } @@ -559,7 +555,7 @@ QList<QUrl> QGpgMENewCryptoConfigEntry::urlValueList() const const Argument arg = m_option.currentValue(); const std::vector<const char *> values = arg.stringValues(); QList<QUrl> ret; - BOOST_FOREACH(const char *value, values) + Q_FOREACH(const char *value, values) if (type == FilenameType) { QUrl url; url.setPath(QFile::decodeName(value)); diff --git a/lang/qt/src/qgpgmenewcryptoconfig.h b/lang/qt/src/qgpgmenewcryptoconfig.h index be184ac9..03915d4e 100644 --- a/lang/qt/src/qgpgmenewcryptoconfig.h +++ b/lang/qt/src/qgpgmenewcryptoconfig.h @@ -47,9 +47,6 @@ # include <gpgme++/configuration.h> #endif -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <boost/enable_shared_from_this.hpp> #include <vector> #include <utility> diff --git a/lang/qt/src/qgpgmesignencryptjob.cpp b/lang/qt/src/qgpgmesignencryptjob.cpp index 16949d7d..e601e6dc 100644 --- a/lang/qt/src/qgpgmesignencryptjob.cpp +++ b/lang/qt/src/qgpgmesignencryptjob.cpp @@ -42,13 +42,11 @@ #include <QBuffer> -#include <boost/weak_ptr.hpp> #include <cassert> using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMESignEncryptJob::QGpgMESignEncryptJob(Context *context) : mixin_type(context), @@ -125,19 +123,19 @@ static QGpgMESignEncryptJob::result_type sign_encrypt_qba(Context *ctx, const st Error QGpgMESignEncryptJob::start(const std::vector<Key> &signers, const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust) { - run(boost::bind(&sign_encrypt_qba, _1, signers, recipients, plainText, alwaysTrust, mOutputIsBase64Encoded)); + run(std::bind(&sign_encrypt_qba, std::placeholders::_1, signers, recipients, plainText, alwaysTrust, mOutputIsBase64Encoded)); return Error(); } void QGpgMESignEncryptJob::start(const std::vector<Key> &signers, const std::vector<Key> &recipients, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &cipherText, bool alwaysTrust) { - run(boost::bind(&sign_encrypt, _1, _2, signers, recipients, _3, _4, alwaysTrust, mOutputIsBase64Encoded), plainText, cipherText); + run(std::bind(&sign_encrypt, std::placeholders::_1, std::placeholders::_2, signers, recipients, std::placeholders::_3, std::placeholders::_4, alwaysTrust, mOutputIsBase64Encoded), plainText, cipherText); } std::pair<SigningResult, EncryptionResult> QGpgMESignEncryptJob::exec(const std::vector<Key> &signers, const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust, QByteArray &cipherText) { const result_type r = sign_encrypt_qba(context(), signers, recipients, plainText, alwaysTrust, mOutputIsBase64Encoded); - cipherText = get<2>(r); + cipherText = std::get<2>(r); resultHook(r); return mResult; } @@ -156,6 +154,6 @@ void QGpgMESignEncryptJob::showErrorDialog(QWidget *parent, const QString &capti void QGpgMESignEncryptJob::resultHook(const result_type &tuple) { - mResult = std::make_pair(get<0>(tuple), get<1>(tuple)); + mResult = std::make_pair(std::get<0>(tuple), std::get<1>(tuple)); } #include "qgpgmesignencryptjob.moc" diff --git a/lang/qt/src/qgpgmesignjob.cpp b/lang/qt/src/qgpgmesignjob.cpp index 1b05b862..9d41dff2 100644 --- a/lang/qt/src/qgpgmesignjob.cpp +++ b/lang/qt/src/qgpgmesignjob.cpp @@ -41,13 +41,11 @@ #include <QBuffer> -#include <boost/weak_ptr.hpp> #include <cassert> using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMESignJob::QGpgMESignJob(Context *context) : mixin_type(context), @@ -131,26 +129,26 @@ static QGpgMESignJob::result_type sign_qba(Context *ctx, Error QGpgMESignJob::start(const std::vector<Key> &signers, const QByteArray &plainText, SignatureMode mode) { - run(boost::bind(&sign_qba, _1, signers, plainText, mode, mOutputIsBase64Encoded)); + run(std::bind(&sign_qba, std::placeholders::_1, signers, plainText, mode, mOutputIsBase64Encoded)); return Error(); } void QGpgMESignJob::start(const std::vector<Key> &signers, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &signature, SignatureMode mode) { - run(boost::bind(&sign, _1, _2, signers, _3, _4, mode, mOutputIsBase64Encoded), plainText, signature); + run(std::bind(&sign, std::placeholders::_1, std::placeholders::_2, signers, std::placeholders::_3, std::placeholders::_4, mode, mOutputIsBase64Encoded), plainText, signature); } SigningResult QGpgMESignJob::exec(const std::vector<Key> &signers, const QByteArray &plainText, SignatureMode mode, QByteArray &signature) { const result_type r = sign_qba(context(), signers, plainText, mode, mOutputIsBase64Encoded); - signature = get<1>(r); + signature = std::get<1>(r); resultHook(r); return mResult; } void QGpgMESignJob::resultHook(const result_type &tuple) { - mResult = get<0>(tuple); + mResult = std::get<0>(tuple); } #if 0 diff --git a/lang/qt/src/qgpgmesignkeyjob.cpp b/lang/qt/src/qgpgmesignkeyjob.cpp index 743f7a0f..4478851d 100644 --- a/lang/qt/src/qgpgmesignkeyjob.cpp +++ b/lang/qt/src/qgpgmesignkeyjob.cpp @@ -44,7 +44,6 @@ using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMESignKeyJob::QGpgMESignKeyJob(Context *context) : mixin_type(context), @@ -91,7 +90,7 @@ Error QGpgMESignKeyJob::start(const Key &key) if (m_exportable) { opts |= GpgSignKeyEditInteractor::Exportable; } - run(boost::bind(&sign_key, _1, key, m_userIDsToSign, m_checkLevel, m_signingKey, opts)); + run(std::bind(&sign_key, std::placeholders::_1, key, m_userIDsToSign, m_checkLevel, m_signingKey, opts)); m_started = true; return Error(); } diff --git a/lang/qt/src/qgpgmeverifydetachedjob.cpp b/lang/qt/src/qgpgmeverifydetachedjob.cpp index 61e1c693..49e40642 100644 --- a/lang/qt/src/qgpgmeverifydetachedjob.cpp +++ b/lang/qt/src/qgpgmeverifydetachedjob.cpp @@ -41,11 +41,9 @@ #include <cassert> -#include <boost/weak_ptr.hpp> using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEVerifyDetachedJob::QGpgMEVerifyDetachedJob(Context *context) : mixin_type(context) @@ -94,13 +92,13 @@ static QGpgMEVerifyDetachedJob::result_type verify_detached_qba(Context *ctx, co Error QGpgMEVerifyDetachedJob::start(const QByteArray &signature, const QByteArray &signedData) { - run(bind(&verify_detached_qba, _1, signature, signedData)); + run(std::bind(&verify_detached_qba, std::placeholders::_1, signature, signedData)); return Error(); } void QGpgMEVerifyDetachedJob::start(const std::shared_ptr<QIODevice> &signature, const std::shared_ptr<QIODevice> &signedData) { - run(bind(&verify_detached, _1, _2, _3, _4), signature, signedData); + run(std::bind(&verify_detached, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4), signature, signedData); } GpgME::VerificationResult QGpgME::QGpgMEVerifyDetachedJob::exec(const QByteArray &signature, @@ -115,6 +113,6 @@ GpgME::VerificationResult QGpgME::QGpgMEVerifyDetachedJob::exec(const QByteArray void QGpgME::QGpgMEVerifyDetachedJob::resultHook(const result_type &tuple) { - mResult = get<0>(tuple); + mResult = std::get<0>(tuple); } #include "qgpgmeverifydetachedjob.moc" diff --git a/lang/qt/src/qgpgmeverifyopaquejob.cpp b/lang/qt/src/qgpgmeverifyopaquejob.cpp index c73541b5..95d55f6f 100644 --- a/lang/qt/src/qgpgmeverifyopaquejob.cpp +++ b/lang/qt/src/qgpgmeverifyopaquejob.cpp @@ -41,13 +41,11 @@ #include <QBuffer> -#include <boost/weak_ptr.hpp> #include <cassert> using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEVerifyOpaqueJob::QGpgMEVerifyOpaqueJob(Context *context) : mixin_type(context) @@ -101,19 +99,19 @@ static QGpgMEVerifyOpaqueJob::result_type verify_opaque_qba(Context *ctx, const Error QGpgMEVerifyOpaqueJob::start(const QByteArray &signedData) { - run(bind(&verify_opaque_qba, _1, signedData)); + run(std::bind(&verify_opaque_qba, std::placeholders::_1, signedData)); return Error(); } void QGpgMEVerifyOpaqueJob::start(const std::shared_ptr<QIODevice> &signedData, const std::shared_ptr<QIODevice> &plainText) { - run(bind(&verify_opaque, _1, _2, _3, _4), signedData, plainText); + run(std::bind(&verify_opaque, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4), signedData, plainText); } GpgME::VerificationResult QGpgME::QGpgMEVerifyOpaqueJob::exec(const QByteArray &signedData, QByteArray &plainText) { const result_type r = verify_opaque_qba(context(), signedData); - plainText = get<1>(r); + plainText = std::get<1>(r); resultHook(r); return mResult; } @@ -122,6 +120,6 @@ GpgME::VerificationResult QGpgME::QGpgMEVerifyOpaqueJob::exec(const QByteArray & void QGpgME::QGpgMEVerifyOpaqueJob::resultHook(const result_type &tuple) { - mResult = get<0>(tuple); + mResult = std::get<0>(tuple); } #include "qgpgmeverifyopaquejob.moc" diff --git a/lang/qt/src/signencryptjob.h b/lang/qt/src/signencryptjob.h index 1f9b4b19..19eadf13 100644 --- a/lang/qt/src/signencryptjob.h +++ b/lang/qt/src/signencryptjob.h @@ -42,8 +42,7 @@ # include <gpgme++/global.h> #endif -#include <boost/shared_ptr.hpp> - +#include <memory> #include <vector> #include <utility> diff --git a/lang/qt/src/signjob.h b/lang/qt/src/signjob.h index 2a2e0edf..1a5e97be 100644 --- a/lang/qt/src/signjob.h +++ b/lang/qt/src/signjob.h @@ -42,9 +42,9 @@ # include <gpgme++/global.h> #endif -#include <boost/shared_ptr.hpp> #include <vector> +#include <memory> class QByteArray; class QIODevice; diff --git a/lang/qt/src/threadedjobmixin.cpp b/lang/qt/src/threadedjobmixin.cpp index 5b072452..efe96686 100644 --- a/lang/qt/src/threadedjobmixin.cpp +++ b/lang/qt/src/threadedjobmixin.cpp @@ -41,14 +41,12 @@ #include <QStringList> #include <QByteArray> -#include <boost/mem_fn.hpp> #include <algorithm> #include <iterator> using namespace QGpgME; using namespace GpgME; -using namespace boost; static const unsigned int GetAuditLogFlags = Context::AuditLogWithHelp | Context::HtmlAuditLog; @@ -100,7 +98,7 @@ const char **_detail::PatternConverter::patterns() const if (!m_patterns) { m_patterns = new const char *[ m_list.size() + 1 ]; const char **end = std::transform(m_list.begin(), m_list.end(), m_patterns, - mem_fn(&QByteArray::constData)); + std::mem_fn(&QByteArray::constData)); *end = 0; } return m_patterns; diff --git a/lang/qt/src/threadedjobmixin.h b/lang/qt/src/threadedjobmixin.h index 6bea871e..c6c96859 100644 --- a/lang/qt/src/threadedjobmixin.h +++ b/lang/qt/src/threadedjobmixin.h @@ -48,13 +48,6 @@ # include <gpgme++/interfaces/progressprovider.h> #endif -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <boost/bind.hpp> -#include <boost/function.hpp> -#include <boost/tuple/tuple.hpp> -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_same.hpp> #include <cassert> @@ -101,7 +94,7 @@ class Thread : public QThread public: explicit Thread(QObject *parent = Q_NULLPTR) : QThread(parent) {} - void setFunction(const boost::function<T_result()> &function) + void setFunction(const std::function<T_result()> &function) { const QMutexLocker locker(&m_mutex); m_function = function; @@ -120,7 +113,7 @@ private: } private: mutable QMutex m_mutex; - boost::function<T_result()> m_function; + std::function<T_result()> m_function; T_result m_result; }; @@ -132,25 +125,24 @@ public: typedef T_result result_type; protected: - BOOST_STATIC_ASSERT((std::tuple_size<T_result>::value > 2)); - BOOST_STATIC_ASSERT(( - std::is_same < - typename std::tuple_element < - std::tuple_size<T_result>::value - 2, - T_result - >::type, - QString - >::value - )); - BOOST_STATIC_ASSERT(( - std::is_same < - typename std::tuple_element < - std::tuple_size<T_result>::value - 1, - T_result - >::type, - GpgME::Error - >::value - )); + static_assert(std::tuple_size<T_result>::value > 2, + "Result tuple too small"); + static_assert(std::is_same < + typename std::tuple_element < + std::tuple_size<T_result>::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<T_result>::value - 1, + T_result + >::type, + GpgME::Error + >::value, + "Last result type not a GpgME::Error"); explicit ThreadedJobMixin(GpgME::Context *ctx) : T_base(0), m_ctx(ctx), m_thread(), m_auditLog(), m_auditLogError() @@ -168,7 +160,7 @@ protected: template <typename T_binder> void run(const T_binder &func) { - m_thread.setFunction(boost::bind(func, this->context())); + m_thread.setFunction(std::bind(func, this->context())); m_thread.start(); } template <typename T_binder> @@ -181,7 +173,7 @@ protected: // 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(boost::bind(func, this->context(), this->thread(), std::weak_ptr<QIODevice>(io))); + m_thread.setFunction(std::bind(func, this->context(), this->thread(), std::weak_ptr<QIODevice>(io))); m_thread.start(); } template <typename T_binder> @@ -197,7 +189,7 @@ protected: // 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(boost::bind(func, this->context(), this->thread(), std::weak_ptr<QIODevice>(io1), std::weak_ptr<QIODevice>(io2))); + m_thread.setFunction(std::bind(func, this->context(), this->thread(), std::weak_ptr<QIODevice>(io1), std::weak_ptr<QIODevice>(io2))); m_thread.start(); } GpgME::Context *context() const diff --git a/lang/qt/src/verifydetachedjob.h b/lang/qt/src/verifydetachedjob.h index 5d78874e..6c237abc 100644 --- a/lang/qt/src/verifydetachedjob.h +++ b/lang/qt/src/verifydetachedjob.h @@ -36,7 +36,7 @@ #include "job.h" -#include <boost/shared_ptr.hpp> +#include <memory> class QByteArray; class QIODevice; diff --git a/lang/qt/src/verifyopaquejob.h b/lang/qt/src/verifyopaquejob.h index 89c592d9..ae9bc899 100644 --- a/lang/qt/src/verifyopaquejob.h +++ b/lang/qt/src/verifyopaquejob.h @@ -36,7 +36,7 @@ #include "job.h" -#include <boost/shared_ptr.hpp> +#include <memory> class QByteArray; class QIODevice; |