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.
This commit is contained in:
Andre Heinecke 2016-04-11 17:15:16 +02:00
parent e18256fc5f
commit afd8fad6e2
31 changed files with 81 additions and 121 deletions

View File

@ -25,10 +25,10 @@
#include "qgpgme_export.h"
#include <interfaces/dataprovider.h>
#include <memory>
#include <QtCore/QByteArray>
#include <boost/shared_ptr.hpp>
class QIODevice;

View File

@ -36,7 +36,7 @@
#include "job.h"
#include <boost/shared_ptr.hpp>
#include <memory>
class QByteArray;
class QIODevice;

View File

@ -36,7 +36,7 @@
#include "job.h"
#include <boost/shared_ptr.hpp>
#include <memory>
class QByteArray;
class QIODevice;

View File

@ -36,8 +36,7 @@
#include "job.h"
#include <boost/shared_ptr.hpp>
#include <memory>
#include <vector>
class QByteArray;

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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();
}

View File

@ -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,

View File

@ -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>

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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 &parameters)
{
run(bind(&generate_key, _1, parameters));
run(std::bind(&generate_key, std::placeholders::_1, parameters));
return Error();
}
#include "qgpgmekeygenerationjob.moc"

View File

@ -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);
}
}

View File

@ -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));

View File

@ -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>

View File

@ -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"

View File

@ -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

View File

@ -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();
}

View File

@ -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"

View File

@ -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"

View File

@ -42,8 +42,7 @@
# include <gpgme++/global.h>
#endif
#include <boost/shared_ptr.hpp>
#include <memory>
#include <vector>
#include <utility>

View File

@ -42,9 +42,9 @@
# include <gpgme++/global.h>
#endif
#include <boost/shared_ptr.hpp>
#include <vector>
#include <memory>
class QByteArray;
class QIODevice;

View File

@ -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;

View File

@ -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 <
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
));
BOOST_STATIC_ASSERT((
std::is_same <
>::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
));
>::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

View File

@ -36,7 +36,7 @@
#include "job.h"
#include <boost/shared_ptr.hpp>
#include <memory>
class QByteArray;
class QIODevice;

View File

@ -36,7 +36,7 @@
#include "job.h"
#include <boost/shared_ptr.hpp>
#include <memory>
class QByteArray;
class QIODevice;