diff options
author | Andre Heinecke <[email protected]> | 2016-04-03 12:52:16 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2016-04-03 12:52:16 +0000 |
commit | f98898ab1a6952e0c3a5d235963a27eba2e19e46 (patch) | |
tree | 2adfdba73a049780a21d47220b052dad5ce391b5 | |
parent | Cpp: Require c++ 11 if cpp binding requested (diff) | |
download | gpgme-f98898ab1a6952e0c3a5d235963a27eba2e19e46.tar.gz gpgme-f98898ab1a6952e0c3a5d235963a27eba2e19e46.zip |
Cpp / Qt: Reduce boost usage (memory and tuple)
* cpp/src/assuanresult.h,
cpp/src/configuration.cpp,
cpp/src/configuration.h,
cpp/src/data.h,
cpp/src/decryptionresult.h,
cpp/src/defaultassuantransaction.cpp,
cpp/src/encryptionresult.cpp,
cpp/src/encryptionresult.h,
cpp/src/engineinfo.h,
cpp/src/gpgagentgetinfoassuantransaction.cpp,
cpp/src/gpgsignkeyeditinteractor.cpp,
cpp/src/importresult.cpp,
cpp/src/importresult.h,
cpp/src/key.h,
cpp/src/keygenerationresult.h,
cpp/src/keylistresult.h,
cpp/src/notation.h,
cpp/src/signingresult.cpp,
cpp/src/signingresult.h,
cpp/src/verificationresult.cpp,
cpp/src/verificationresult.h,
cpp/src/vfsmountresult.h,
qt/src/dataprovider.cpp,
qt/src/dataprovider.h,
qt/src/decryptjob.h,
qt/src/decryptverifyjob.h,
qt/src/downloadjob.h,
qt/src/encryptjob.h,
qt/src/qgpgmeadduseridjob.cpp,
qt/src/qgpgmechangeexpiryjob.cpp,
qt/src/qgpgmechangeownertrustjob.cpp,
qt/src/qgpgmechangepasswdjob.cpp,
qt/src/qgpgmedecryptjob.cpp,
qt/src/qgpgmedecryptjob.h,
qt/src/qgpgmedecryptverifyjob.cpp,
qt/src/qgpgmedecryptverifyjob.h,
qt/src/qgpgmedeletejob.cpp,
qt/src/qgpgmedownloadjob.cpp,
qt/src/qgpgmedownloadjob.h,
qt/src/qgpgmeencryptjob.cpp,
qt/src/qgpgmeencryptjob.h,
qt/src/qgpgmeexportjob.cpp,
qt/src/qgpgmeexportjob.h,
qt/src/qgpgmeimportfromkeyserverjob.cpp,
qt/src/qgpgmeimportfromkeyserverjob.h,
qt/src/qgpgmeimportjob.cpp,
qt/src/qgpgmeimportjob.h,
qt/src/qgpgmekeygenerationjob.cpp,
qt/src/qgpgmekeygenerationjob.h,
qt/src/qgpgmekeylistjob.cpp,
qt/src/qgpgmekeylistjob.h,
qt/src/qgpgmelistallkeysjob.cpp,
qt/src/qgpgmelistallkeysjob.h,
qt/src/qgpgmenewcryptoconfig.cpp,
qt/src/qgpgmenewcryptoconfig.h,
qt/src/qgpgmesignencryptjob.cpp,
qt/src/qgpgmesignencryptjob.h,
qt/src/qgpgmesignjob.cpp,
qt/src/qgpgmesignjob.h,
qt/src/qgpgmesignkeyjob.cpp,
qt/src/qgpgmeverifydetachedjob.cpp,
qt/src/qgpgmeverifydetachedjob.h,
qt/src/qgpgmeverifyopaquejob.cpp,
qt/src/qgpgmeverifyopaquejob.h,
qt/src/signencryptjob.h,
qt/src/signjob.h,
qt/src/threadedjobmixin.h,
qt/src/verifydetachedjob.h,
qt/src/verifyopaquejob.h: Reduce boost usage.
--
This was mostly done with search and replace to change the
templates / classes from memory and tuple to their c++11
equivalents.
69 files changed, 232 insertions, 264 deletions
diff --git a/lang/cpp/src/assuanresult.h b/lang/cpp/src/assuanresult.h index e1dc73af..e59b5ac2 100644 --- a/lang/cpp/src/assuanresult.h +++ b/lang/cpp/src/assuanresult.h @@ -30,10 +30,9 @@ #include <time.h> -#include <boost/shared_ptr.hpp> - #include <vector> #include <iosfwd> +#include <memory> namespace GpgME { @@ -68,7 +67,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const AssuanResult &result); diff --git a/lang/cpp/src/configuration.cpp b/lang/cpp/src/configuration.cpp index 8a23efcf..4bd01867 100644 --- a/lang/cpp/src/configuration.cpp +++ b/lang/cpp/src/configuration.cpp @@ -32,18 +32,19 @@ #include <algorithm> #include <ostream> #include <cstring> +#include <assert.h> using namespace GpgME; using namespace GpgME::Configuration; -typedef boost::shared_ptr< boost::remove_pointer<gpgme_conf_opt_t>::type > shared_gpgme_conf_opt_t; -typedef boost::weak_ptr< boost::remove_pointer<gpgme_conf_opt_t>::type > weak_gpgme_conf_opt_t; +typedef std::shared_ptr< boost::remove_pointer<gpgme_conf_opt_t>::type > shared_gpgme_conf_opt_t; +typedef std::weak_ptr< boost::remove_pointer<gpgme_conf_opt_t>::type > weak_gpgme_conf_opt_t; -typedef boost::shared_ptr< boost::remove_pointer<gpgme_conf_arg_t>::type > shared_gpgme_conf_arg_t; -typedef boost::weak_ptr< boost::remove_pointer<gpgme_conf_arg_t>::type > weak_gpgme_conf_arg_t; +typedef std::shared_ptr< boost::remove_pointer<gpgme_conf_arg_t>::type > shared_gpgme_conf_arg_t; +typedef std::weak_ptr< boost::remove_pointer<gpgme_conf_arg_t>::type > weak_gpgme_conf_arg_t; -typedef boost::shared_ptr< boost::remove_pointer<gpgme_ctx_t>::type > shared_gpgme_ctx_t; -typedef boost::weak_ptr< boost::remove_pointer<gpgme_ctx_t>::type > weak_gpgme_ctx_t; +typedef std::shared_ptr< boost::remove_pointer<gpgme_ctx_t>::type > shared_gpgme_ctx_t; +typedef std::weak_ptr< boost::remove_pointer<gpgme_ctx_t>::type > weak_gpgme_ctx_t; namespace { diff --git a/lang/cpp/src/configuration.h b/lang/cpp/src/configuration.h index e6e13db4..288a410d 100644 --- a/lang/cpp/src/configuration.h +++ b/lang/cpp/src/configuration.h @@ -28,26 +28,19 @@ #include "gpgmefw.h" -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <boost/type_traits/remove_pointer.hpp> -#if 0 -#include <boost/variant.hpp> -#include <boost/optional.hpp> -#endif - #include <iosfwd> #include <vector> #include <string> #include <algorithm> +#include <memory> namespace GpgME { namespace Configuration { -typedef boost::shared_ptr< boost::remove_pointer<gpgme_conf_comp_t>::type > shared_gpgme_conf_comp_t; -typedef boost::weak_ptr< boost::remove_pointer<gpgme_conf_comp_t>::type > weak_gpgme_conf_comp_t; +typedef std::shared_ptr< std::remove_pointer<gpgme_conf_comp_t>::type > shared_gpgme_conf_comp_t; +typedef std::weak_ptr< std::remove_pointer<gpgme_conf_comp_t>::type > weak_gpgme_conf_comp_t; class Argument; class Option; diff --git a/lang/cpp/src/data.h b/lang/cpp/src/data.h index c8a599ed..97e42029 100644 --- a/lang/cpp/src/data.h +++ b/lang/cpp/src/data.h @@ -25,11 +25,10 @@ #include "global.h" -#include <boost/shared_ptr.hpp> - #include <sys/types.h> // for size_t, off_t #include <cstdio> // FILE #include <algorithm> +#include <memory> namespace GpgME { @@ -100,7 +99,7 @@ public: return d.get(); } private: - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; } diff --git a/lang/cpp/src/decryptionresult.h b/lang/cpp/src/decryptionresult.h index 2374cbba..60b78d9c 100644 --- a/lang/cpp/src/decryptionresult.h +++ b/lang/cpp/src/decryptionresult.h @@ -27,11 +27,10 @@ #include "result.h" #include "gpgmepp_export.h" -#include <boost/shared_ptr.hpp> - #include <vector> #include <algorithm> #include <iosfwd> +#include <memory> namespace GpgME { @@ -84,7 +83,7 @@ public: private: class Private; void init(gpgme_ctx_t ctx); - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const DecryptionResult &result); @@ -119,7 +118,7 @@ public: private: class Private; - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const DecryptionResult::Recipient &reci); diff --git a/lang/cpp/src/defaultassuantransaction.cpp b/lang/cpp/src/defaultassuantransaction.cpp index 4c305729..5bcf9705 100644 --- a/lang/cpp/src/defaultassuantransaction.cpp +++ b/lang/cpp/src/defaultassuantransaction.cpp @@ -27,7 +27,6 @@ #include <sstream> using namespace GpgME; -using namespace boost; DefaultAssuanTransaction::DefaultAssuanTransaction() : AssuanTransaction(), diff --git a/lang/cpp/src/encryptionresult.cpp b/lang/cpp/src/encryptionresult.cpp index 5bedec8e..c4e7df51 100644 --- a/lang/cpp/src/encryptionresult.cpp +++ b/lang/cpp/src/encryptionresult.cpp @@ -111,7 +111,7 @@ std::vector<GpgME::InvalidRecipient> GpgME::EncryptionResult::invalidEncryptionK return result; } -GpgME::InvalidRecipient::InvalidRecipient(const boost::shared_ptr<EncryptionResult::Private> &parent, unsigned int i) +GpgME::InvalidRecipient::InvalidRecipient(const std::shared_ptr<EncryptionResult::Private> &parent, unsigned int i) : d(parent), idx(i) { diff --git a/lang/cpp/src/encryptionresult.h b/lang/cpp/src/encryptionresult.h index 1f5d16f6..edc400fb 100644 --- a/lang/cpp/src/encryptionresult.h +++ b/lang/cpp/src/encryptionresult.h @@ -27,7 +27,7 @@ #include "result.h" #include "gpgmepp_export.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <vector> #include <iosfwd> @@ -69,7 +69,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const EncryptionResult &result); @@ -77,7 +77,7 @@ GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const EncryptionResult class GPGMEPP_EXPORT InvalidRecipient { friend class ::GpgME::EncryptionResult; - InvalidRecipient(const boost::shared_ptr<EncryptionResult::Private> &parent, unsigned int index); + InvalidRecipient(const std::shared_ptr<EncryptionResult::Private> &parent, unsigned int index); public: InvalidRecipient(); @@ -99,7 +99,7 @@ public: Error reason() const; private: - boost::shared_ptr<EncryptionResult::Private> d; + std::shared_ptr<EncryptionResult::Private> d; unsigned int idx; }; diff --git a/lang/cpp/src/engineinfo.h b/lang/cpp/src/engineinfo.h index 94c52bd1..4de9884f 100644 --- a/lang/cpp/src/engineinfo.h +++ b/lang/cpp/src/engineinfo.h @@ -25,7 +25,7 @@ #include "global.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <algorithm> @@ -60,7 +60,7 @@ public: private: class Private; - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; } diff --git a/lang/cpp/src/gpgagentgetinfoassuantransaction.cpp b/lang/cpp/src/gpgagentgetinfoassuantransaction.cpp index 6ab58c24..4739aa29 100644 --- a/lang/cpp/src/gpgagentgetinfoassuantransaction.cpp +++ b/lang/cpp/src/gpgagentgetinfoassuantransaction.cpp @@ -25,12 +25,11 @@ #include "data.h" #include "util.h" -#include <boost/static_assert.hpp> +#include <assert.h> #include <sstream> using namespace GpgME; -using namespace boost; GpgAgentGetInfoAssuanTransaction::GpgAgentGetInfoAssuanTransaction(InfoItem item) : AssuanTransaction(), @@ -86,7 +85,6 @@ static const char *const gpgagent_getinfo_tokens[] = { "ssh_socket_name", "scd_running", }; -BOOST_STATIC_ASSERT((sizeof gpgagent_getinfo_tokens / sizeof * gpgagent_getinfo_tokens == GpgAgentGetInfoAssuanTransaction::LastInfoItem)); void GpgAgentGetInfoAssuanTransaction::makeCommand() const { diff --git a/lang/cpp/src/gpgsignkeyeditinteractor.cpp b/lang/cpp/src/gpgsignkeyeditinteractor.cpp index 1950b2f9..fded90f8 100644 --- a/lang/cpp/src/gpgsignkeyeditinteractor.cpp +++ b/lang/cpp/src/gpgsignkeyeditinteractor.cpp @@ -26,9 +26,6 @@ #include <gpgme.h> -#include <boost/tuple/tuple.hpp> -#include <boost/tuple/tuple_comparison.hpp> - #include <map> #include <string> #include <sstream> @@ -48,7 +45,6 @@ using std::strcmp; #define snprintf _snprintf #endif -using namespace boost; using namespace GpgME; class GpgSignKeyEditInteractor::Private @@ -161,7 +157,7 @@ enum SignKeyState { ERROR = EditInteractor::ErrorState }; -typedef std::map<tuple<SignKeyState, unsigned int, std::string>, SignKeyState> TransitionMap; +typedef std::map<std::tuple<SignKeyState, unsigned int, std::string>, SignKeyState> TransitionMap; } @@ -176,7 +172,7 @@ static GpgSignKeyEditInteractor_Private::TransitionMap makeTable() TransitionMap tab; const unsigned int GET_BOOL = GPGME_STATUS_GET_BOOL; const unsigned int GET_LINE = GPGME_STATUS_GET_LINE; -#define addEntry( s1, status, str, s2 ) tab[make_tuple( s1, status, str)] = s2 +#define addEntry( s1, status, str, s2 ) tab[std::make_tuple( s1, status, str)] = s2 addEntry(START, GET_LINE, "keyedit.prompt", COMMAND); addEntry(COMMAND, GET_BOOL, "keyedit.sign_all.okay", UIDS_ANSWER_SIGN_ALL); addEntry(COMMAND, GET_BOOL, "sign_uid.okay", CONFIRM); @@ -265,7 +261,7 @@ unsigned int GpgSignKeyEditInteractor::nextState(unsigned int status, const char using namespace GpgSignKeyEditInteractor_Private; //lookup transition in map - const TransitionMap::const_iterator it = table.find(boost::make_tuple(static_cast<SignKeyState>(state()), status, std::string(args))); + const TransitionMap::const_iterator it = table.find(std::make_tuple(static_cast<SignKeyState>(state()), status, std::string(args))); if (it != table.end()) { return it->second; } diff --git a/lang/cpp/src/importresult.cpp b/lang/cpp/src/importresult.cpp index 532f73d1..97e82399 100644 --- a/lang/cpp/src/importresult.cpp +++ b/lang/cpp/src/importresult.cpp @@ -166,7 +166,7 @@ std::vector<GpgME::Import> GpgME::ImportResult::imports() const return result; } -GpgME::Import::Import(const boost::shared_ptr<ImportResult::Private> &parent, unsigned int i) +GpgME::Import::Import(const std::shared_ptr<ImportResult::Private> &parent, unsigned int i) : d(parent), idx(i) { diff --git a/lang/cpp/src/importresult.h b/lang/cpp/src/importresult.h index 7dc0320b..adda80a4 100644 --- a/lang/cpp/src/importresult.h +++ b/lang/cpp/src/importresult.h @@ -27,7 +27,7 @@ #include "result.h" #include "gpgmepp_export.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <vector> @@ -83,13 +83,13 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; class GPGMEPP_EXPORT Import { friend class ::GpgME::ImportResult; - Import(const boost::shared_ptr<ImportResult::Private> &parent, unsigned int idx); + Import(const std::shared_ptr<ImportResult::Private> &parent, unsigned int idx); public: Import(); @@ -122,7 +122,7 @@ public: Status status() const; private: - boost::shared_ptr<ImportResult::Private> d; + std::shared_ptr<ImportResult::Private> d; unsigned int idx; }; diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index 80bf4d19..a87a35cf 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -29,9 +29,7 @@ #include "gpgmefw.h" -#include <boost/shared_ptr.hpp> -#include <boost/type_traits/remove_pointer.hpp> - +#include <memory> #include <sys/time.h> #include <vector> @@ -46,7 +44,7 @@ class Context; class Subkey; class UserID; -typedef boost::shared_ptr< boost::remove_pointer<gpgme_key_t>::type > shared_gpgme_key_t; +typedef std::shared_ptr< std::remove_pointer<gpgme_key_t>::type > shared_gpgme_key_t; // // class Key diff --git a/lang/cpp/src/keygenerationresult.h b/lang/cpp/src/keygenerationresult.h index c4aaad11..c35c5044 100644 --- a/lang/cpp/src/keygenerationresult.h +++ b/lang/cpp/src/keygenerationresult.h @@ -27,7 +27,7 @@ #include "result.h" #include "gpgmepp_export.h" -#include <boost/shared_ptr.hpp> +#include <memory> namespace GpgME { @@ -72,7 +72,7 @@ public: private: class Private; void init(gpgme_ctx_t ctx); - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; } diff --git a/lang/cpp/src/keylistresult.h b/lang/cpp/src/keylistresult.h index 618573be..7dfe2d71 100644 --- a/lang/cpp/src/keylistresult.h +++ b/lang/cpp/src/keylistresult.h @@ -27,7 +27,7 @@ #include "result.h" #include "gpgmepp_export.h" -#include <boost/shared_ptr.hpp> +#include <memory> namespace GpgME { @@ -71,7 +71,7 @@ private: void detach(); void init(gpgme_ctx_t ctx); class Private; - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; } diff --git a/lang/cpp/src/notation.h b/lang/cpp/src/notation.h index c53237c0..807bdaad 100644 --- a/lang/cpp/src/notation.h +++ b/lang/cpp/src/notation.h @@ -27,7 +27,7 @@ #include "verificationresult.h" #include "gpgmepp_export.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <iosfwd> @@ -37,7 +37,7 @@ namespace GpgME class GPGMEPP_EXPORT Notation { friend class ::GpgME::Signature; - Notation(const boost::shared_ptr<VerificationResult::Private> &parent, unsigned int sindex, unsigned int nindex); + Notation(const std::shared_ptr<VerificationResult::Private> &parent, unsigned int sindex, unsigned int nindex); public: Notation(); explicit Notation(gpgme_sig_notation_t nota); @@ -71,7 +71,7 @@ public: private: class Private; - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Notation ¬a); diff --git a/lang/cpp/src/signingresult.cpp b/lang/cpp/src/signingresult.cpp index e97ea2d7..4f2ef72e 100644 --- a/lang/cpp/src/signingresult.cpp +++ b/lang/cpp/src/signingresult.cpp @@ -137,7 +137,7 @@ std::vector<GpgME::InvalidSigningKey> GpgME::SigningResult::invalidSigningKeys() return result; } -GpgME::InvalidSigningKey::InvalidSigningKey(const boost::shared_ptr<SigningResult::Private> &parent, unsigned int i) +GpgME::InvalidSigningKey::InvalidSigningKey(const std::shared_ptr<SigningResult::Private> &parent, unsigned int i) : d(parent), idx(i) { @@ -160,7 +160,7 @@ GpgME::Error GpgME::InvalidSigningKey::reason() const return Error(isNull() ? 0 : d->invalid[idx]->reason); } -GpgME::CreatedSignature::CreatedSignature(const boost::shared_ptr<SigningResult::Private> &parent, unsigned int i) +GpgME::CreatedSignature::CreatedSignature(const std::shared_ptr<SigningResult::Private> &parent, unsigned int i) : d(parent), idx(i) { diff --git a/lang/cpp/src/signingresult.h b/lang/cpp/src/signingresult.h index 1847fb0b..2c274549 100644 --- a/lang/cpp/src/signingresult.h +++ b/lang/cpp/src/signingresult.h @@ -28,7 +28,7 @@ #include <time.h> -#include <boost/shared_ptr.hpp> +#include <memory> #include <vector> #include <iosfwd> @@ -72,7 +72,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const SigningResult &result); @@ -80,7 +80,7 @@ GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const SigningResult &r class GPGMEPP_EXPORT InvalidSigningKey { friend class ::GpgME::SigningResult; - InvalidSigningKey(const boost::shared_ptr<SigningResult::Private> &parent, unsigned int index); + InvalidSigningKey(const std::shared_ptr<SigningResult::Private> &parent, unsigned int index); public: InvalidSigningKey(); @@ -103,7 +103,7 @@ public: Error reason() const; private: - boost::shared_ptr<SigningResult::Private> d; + std::shared_ptr<SigningResult::Private> d; unsigned int idx; }; @@ -112,7 +112,7 @@ GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const InvalidSigningKe class GPGMEPP_EXPORT CreatedSignature { friend class ::GpgME::SigningResult; - CreatedSignature(const boost::shared_ptr<SigningResult::Private> &parent, unsigned int index); + CreatedSignature(const std::shared_ptr<SigningResult::Private> &parent, unsigned int index); public: CreatedSignature(); @@ -147,7 +147,7 @@ public: unsigned int signatureClass() const; private: - boost::shared_ptr<SigningResult::Private> d; + std::shared_ptr<SigningResult::Private> d; unsigned int idx; }; diff --git a/lang/cpp/src/verificationresult.cpp b/lang/cpp/src/verificationresult.cpp index 92a77b6e..b6fde7da 100644 --- a/lang/cpp/src/verificationresult.cpp +++ b/lang/cpp/src/verificationresult.cpp @@ -165,7 +165,7 @@ std::vector<GpgME::Signature> GpgME::VerificationResult::signatures() const return result; } -GpgME::Signature::Signature(const boost::shared_ptr<VerificationResult::Private> &parent, unsigned int i) +GpgME::Signature::Signature(const std::shared_ptr<VerificationResult::Private> &parent, unsigned int i) : d(parent), idx(i) { } @@ -367,7 +367,7 @@ class GpgME::Notation::Private { public: Private() : d(), sidx(0), nidx(0), nota(0) {} - Private(const boost::shared_ptr<VerificationResult::Private> &priv, unsigned int sindex, unsigned int nindex) + Private(const std::shared_ptr<VerificationResult::Private> &priv, unsigned int sindex, unsigned int nindex) : d(priv), sidx(sindex), nidx(nindex), nota(0) { @@ -399,12 +399,12 @@ public: } } - boost::shared_ptr<VerificationResult::Private> d; + std::shared_ptr<VerificationResult::Private> d; unsigned int sidx, nidx; gpgme_sig_notation_t nota; }; -GpgME::Notation::Notation(const boost::shared_ptr<VerificationResult::Private> &parent, unsigned int sindex, unsigned int nindex) +GpgME::Notation::Notation(const std::shared_ptr<VerificationResult::Private> &parent, unsigned int sindex, unsigned int nindex) : d(new Private(parent, sindex, nindex)) { diff --git a/lang/cpp/src/verificationresult.h b/lang/cpp/src/verificationresult.h index 8372d88b..17f0568b 100644 --- a/lang/cpp/src/verificationresult.h +++ b/lang/cpp/src/verificationresult.h @@ -29,7 +29,7 @@ #include <time.h> -#include <boost/shared_ptr.hpp> +#include <memory> #include <vector> #include <iosfwd> @@ -73,7 +73,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const VerificationResult &result); @@ -81,7 +81,7 @@ GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const VerificationResu class GPGMEPP_EXPORT Signature { friend class ::GpgME::VerificationResult; - Signature(const boost::shared_ptr<VerificationResult::Private> &parent, unsigned int index); + Signature(const std::shared_ptr<VerificationResult::Private> &parent, unsigned int index); public: typedef GPGMEPP_DEPRECATED GpgME::Notation Notation; @@ -157,7 +157,7 @@ public: std::vector<GpgME::Notation> notations() const; private: - boost::shared_ptr<VerificationResult::Private> d; + std::shared_ptr<VerificationResult::Private> d; unsigned int idx; }; diff --git a/lang/cpp/src/vfsmountresult.h b/lang/cpp/src/vfsmountresult.h index 0f06bd27..abdd655d 100644 --- a/lang/cpp/src/vfsmountresult.h +++ b/lang/cpp/src/vfsmountresult.h @@ -28,7 +28,7 @@ #include "result.h" #include "gpgmepp_export.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <vector> #include <iosfwd> @@ -64,7 +64,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr<Private> d; + std::shared_ptr<Private> d; }; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const VfsMountResult &result); diff --git a/lang/qt/src/dataprovider.cpp b/lang/qt/src/dataprovider.cpp index 9cb5a641..533b67dc 100644 --- a/lang/qt/src/dataprovider.cpp +++ b/lang/qt/src/dataprovider.cpp @@ -144,7 +144,7 @@ void QByteArrayDataProvider::release() // // -QIODeviceDataProvider::QIODeviceDataProvider(const boost::shared_ptr<QIODevice> &io) +QIODeviceDataProvider::QIODeviceDataProvider(const std::shared_ptr<QIODevice> &io) : GpgME::DataProvider(), mIO(io), mErrorOccurred(false), @@ -172,7 +172,7 @@ bool QIODeviceDataProvider::isSupported(Operation op) const } } -static qint64 blocking_read(const boost::shared_ptr<QIODevice> &io, char *buffer, qint64 maxSize) +static qint64 blocking_read(const std::shared_ptr<QIODevice> &io, char *buffer, qint64 maxSize) { while (!io->bytesAvailable()) { if (!io->waitForReadyRead(-1)) { diff --git a/lang/qt/src/dataprovider.h b/lang/qt/src/dataprovider.h index 5df4fc22..165e4f4a 100644 --- a/lang/qt/src/dataprovider.h +++ b/lang/qt/src/dataprovider.h @@ -72,10 +72,10 @@ private: class QGPGME_EXPORT QIODeviceDataProvider : public GpgME::DataProvider { public: - explicit QIODeviceDataProvider(const boost::shared_ptr<QIODevice> &initialData); + explicit QIODeviceDataProvider(const std::shared_ptr<QIODevice> &initialData); ~QIODeviceDataProvider(); - const boost::shared_ptr<QIODevice> &ioDevice() const + const std::shared_ptr<QIODevice> &ioDevice() const { return mIO; } @@ -95,7 +95,7 @@ private: void release(); private: - const boost::shared_ptr<QIODevice> mIO; + const std::shared_ptr<QIODevice> mIO; bool mErrorOccurred : 1; bool mHaveQProcess : 1; }; diff --git a/lang/qt/src/decryptjob.h b/lang/qt/src/decryptjob.h index e2012760..04c603a4 100644 --- a/lang/qt/src/decryptjob.h +++ b/lang/qt/src/decryptjob.h @@ -86,7 +86,7 @@ public: \throws GpgME::Exception if starting fails */ - virtual void start(const boost::shared_ptr<QIODevice> &cipherText, const boost::shared_ptr<QIODevice> &plainText = boost::shared_ptr<QIODevice>()) = 0; + virtual void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText = std::shared_ptr<QIODevice>()) = 0; virtual GpgME::DecryptionResult exec(const QByteArray &cipherText, QByteArray &plainText) = 0; diff --git a/lang/qt/src/decryptverifyjob.h b/lang/qt/src/decryptverifyjob.h index fc51a202..fa0d1d22 100644 --- a/lang/qt/src/decryptverifyjob.h +++ b/lang/qt/src/decryptverifyjob.h @@ -87,7 +87,7 @@ public: \throws GpgME::Exception if starting fails */ - virtual void start(const boost::shared_ptr<QIODevice> &cipherText, const boost::shared_ptr<QIODevice> &plainText = boost::shared_ptr<QIODevice>()) = 0; + virtual void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText = std::shared_ptr<QIODevice>()) = 0; /** Synchronous equivalent of start() */ virtual std::pair<GpgME::DecryptionResult, GpgME::VerificationResult> diff --git a/lang/qt/src/downloadjob.h b/lang/qt/src/downloadjob.h index 4c1ee981..757d76ed 100644 --- a/lang/qt/src/downloadjob.h +++ b/lang/qt/src/downloadjob.h @@ -38,16 +38,13 @@ #include <QtCore/QByteArray> +#include <memory> + namespace GpgME { class Error; } -namespace boost -{ -template <typename T> class shared_ptr; -} - class QStringList; class QIODevice; class QByteArray; @@ -86,7 +83,7 @@ public: passed as the second argument of result(). */ virtual GpgME::Error start(const QByteArray &fingerprint, - const boost::shared_ptr<QIODevice> &keyData) = 0; + const std::shared_ptr<QIODevice> &keyData) = 0; /** Starts the download operation. \a fingerprints is a list of diff --git a/lang/qt/src/encryptjob.h b/lang/qt/src/encryptjob.h index 91ad5e69..1fd28905 100644 --- a/lang/qt/src/encryptjob.h +++ b/lang/qt/src/encryptjob.h @@ -97,8 +97,8 @@ public: \throws GpgME::Exception if starting fails */ virtual void start(const std::vector<GpgME::Key> &recipients, - const boost::shared_ptr<QIODevice> &plainText, - const boost::shared_ptr<QIODevice> &cipherText = boost::shared_ptr<QIODevice>(), + const std::shared_ptr<QIODevice> &plainText, + const std::shared_ptr<QIODevice> &cipherText = std::shared_ptr<QIODevice>(), bool alwaysTrust = false) = 0; virtual GpgME::EncryptionResult exec(const std::vector<GpgME::Key> &recipients, diff --git a/lang/qt/src/qgpgmeadduseridjob.cpp b/lang/qt/src/qgpgmeadduseridjob.cpp index 03e8f20f..2155675e 100644 --- a/lang/qt/src/qgpgmeadduseridjob.cpp +++ b/lang/qt/src/qgpgmeadduseridjob.cpp @@ -72,7 +72,7 @@ static QGpgMEAddUserIDJob::result_type add_user_id(Context *ctx, const Key &key, const Error err = ctx->edit(key, ei, data); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(err, log, ae); + return std::make_tuple(err, log, ae); } Error QGpgMEAddUserIDJob::start(const Key &key, const QString &name, const QString &email, const QString &comment) diff --git a/lang/qt/src/qgpgmechangeexpiryjob.cpp b/lang/qt/src/qgpgmechangeexpiryjob.cpp index 41fe8c34..d0a93d82 100644 --- a/lang/qt/src/qgpgmechangeexpiryjob.cpp +++ b/lang/qt/src/qgpgmechangeexpiryjob.cpp @@ -71,7 +71,7 @@ static QGpgMEChangeExpiryJob::result_type change_expiry(Context *ctx, const Key const Error err = ctx->edit(key, ei, data); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(err, log, ae); + return std::make_tuple(err, log, ae); } Error QGpgMEChangeExpiryJob::start(const Key &key, const QDateTime &expiry) diff --git a/lang/qt/src/qgpgmechangeownertrustjob.cpp b/lang/qt/src/qgpgmechangeownertrustjob.cpp index 09b95394..8d9f00f6 100644 --- a/lang/qt/src/qgpgmechangeownertrustjob.cpp +++ b/lang/qt/src/qgpgmechangeownertrustjob.cpp @@ -67,7 +67,7 @@ static QGpgMEChangeOwnerTrustJob::result_type change_ownertrust(Context *ctx, co const Error err = ctx->edit(key, ei, data); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(err, log, ae); + return std::make_tuple(err, log, ae); } Error QGpgMEChangeOwnerTrustJob::start(const Key &key, Key::OwnerTrust trust) diff --git a/lang/qt/src/qgpgmechangepasswdjob.cpp b/lang/qt/src/qgpgmechangepasswdjob.cpp index a182214c..eb9937fa 100644 --- a/lang/qt/src/qgpgmechangepasswdjob.cpp +++ b/lang/qt/src/qgpgmechangepasswdjob.cpp @@ -68,7 +68,7 @@ static QGpgMEChangePasswdJob::result_type change_passwd(Context *ctx, const Key #endif Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(err, log, ae); + return std::make_tuple(err, log, ae); } Error QGpgMEChangePasswdJob::start(const Key &key) diff --git a/lang/qt/src/qgpgmedecryptjob.cpp b/lang/qt/src/qgpgmedecryptjob.cpp index 9ce41819..4c2319c0 100644 --- a/lang/qt/src/qgpgmedecryptjob.cpp +++ b/lang/qt/src/qgpgmedecryptjob.cpp @@ -41,13 +41,10 @@ #include <QBuffer> -#include <boost/weak_ptr.hpp> - #include <cassert> using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEDecryptJob::QGpgMEDecryptJob(Context *context) : mixin_type(context) @@ -57,11 +54,13 @@ QGpgMEDecryptJob::QGpgMEDecryptJob(Context *context) QGpgMEDecryptJob::~QGpgMEDecryptJob() {} -static QGpgMEDecryptJob::result_type decrypt(Context *ctx, QThread *thread, const weak_ptr<QIODevice> &cipherText_, const weak_ptr<QIODevice> &plainText_) +static QGpgMEDecryptJob::result_type decrypt(Context *ctx, QThread *thread, + const std::weak_ptr<QIODevice> &cipherText_, + const std::weak_ptr<QIODevice> &plainText_) { - const shared_ptr<QIODevice> cipherText = cipherText_.lock(); - const shared_ptr<QIODevice> plainText = plainText_.lock(); + const std::shared_ptr<QIODevice> cipherText = cipherText_.lock(); + const std::shared_ptr<QIODevice> plainText = plainText_.lock(); const _detail::ToThreadMover ctMover(cipherText, thread); const _detail::ToThreadMover ptMover(plainText, thread); @@ -76,7 +75,7 @@ static QGpgMEDecryptJob::result_type decrypt(Context *ctx, QThread *thread, cons const DecryptionResult res = ctx->decrypt(indata, outdata); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, out.data(), log, ae); + return std::make_tuple(res, out.data(), log, ae); } else { QGpgME::QIODeviceDataProvider out(plainText); Data outdata(&out); @@ -84,19 +83,19 @@ static QGpgMEDecryptJob::result_type decrypt(Context *ctx, QThread *thread, cons const DecryptionResult res = ctx->decrypt(indata, outdata); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, QByteArray(), log, ae); + return std::make_tuple(res, QByteArray(), log, ae); } } static QGpgMEDecryptJob::result_type decrypt_qba(Context *ctx, const QByteArray &cipherText) { - const shared_ptr<QBuffer> buffer(new QBuffer); + const std::shared_ptr<QBuffer> buffer(new QBuffer); buffer->setData(cipherText); if (!buffer->open(QIODevice::ReadOnly)) { assert(!"This should never happen: QBuffer::open() failed"); } - return decrypt(ctx, 0, buffer, shared_ptr<QIODevice>()); + return decrypt(ctx, 0, buffer, std::shared_ptr<QIODevice>()); } Error QGpgMEDecryptJob::start(const QByteArray &cipherText) @@ -105,7 +104,7 @@ Error QGpgMEDecryptJob::start(const QByteArray &cipherText) return Error(); } -void QGpgMEDecryptJob::start(const shared_ptr<QIODevice> &cipherText, const shared_ptr<QIODevice> &plainText) +void QGpgMEDecryptJob::start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText) { run(bind(&decrypt, _1, _2, _3, _4), cipherText, plainText); } @@ -114,7 +113,7 @@ GpgME::DecryptionResult QGpgME::QGpgMEDecryptJob::exec(const QByteArray &cipherT QByteArray &plainText) { const result_type r = decrypt_qba(context(), cipherText); - plainText = get<1>(r); + plainText = std::get<1>(r); resultHook(r); return mResult; } @@ -123,7 +122,7 @@ GpgME::DecryptionResult QGpgME::QGpgMEDecryptJob::exec(const QByteArray &cipherT void QGpgMEDecryptJob::resultHook(const result_type &tuple) { - mResult = get<0>(tuple); + mResult = std::get<0>(tuple); } #include "qgpgmedecryptjob.moc" diff --git a/lang/qt/src/qgpgmedecryptjob.h b/lang/qt/src/qgpgmedecryptjob.h index 55eb26ec..e87120b2 100644 --- a/lang/qt/src/qgpgmedecryptjob.h +++ b/lang/qt/src/qgpgmedecryptjob.h @@ -51,7 +51,7 @@ class QGpgMEDecryptJob #ifdef Q_MOC_RUN : public DecryptJob #else - : public _detail::ThreadedJobMixin<DecryptJob, boost::tuple<GpgME::DecryptionResult, QByteArray, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<DecryptJob, std::tuple<GpgME::DecryptionResult, QByteArray, QString, GpgME::Error> > #endif { Q_OBJECT @@ -67,7 +67,7 @@ public: GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE; /*! \reimp from DecryptJob */ - void start(const boost::shared_ptr<QIODevice> &cipherText, const boost::shared_ptr<QIODevice> &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText) Q_DECL_OVERRIDE; /*! \reimp from DecryptJob */ GpgME::DecryptionResult exec(const QByteArray &cipherText, diff --git a/lang/qt/src/qgpgmedecryptverifyjob.cpp b/lang/qt/src/qgpgmedecryptverifyjob.cpp index 7e6c4b55..8c7ef972 100644 --- a/lang/qt/src/qgpgmedecryptverifyjob.cpp +++ b/lang/qt/src/qgpgmedecryptverifyjob.cpp @@ -45,13 +45,10 @@ #include <QBuffer> -#include <boost/weak_ptr.hpp> - #include <cassert> using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEDecryptVerifyJob::QGpgMEDecryptVerifyJob(Context *context) : mixin_type(context) @@ -61,13 +58,15 @@ QGpgMEDecryptVerifyJob::QGpgMEDecryptVerifyJob(Context *context) QGpgMEDecryptVerifyJob::~QGpgMEDecryptVerifyJob() {} -static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread *thread, const weak_ptr<QIODevice> &cipherText_, const weak_ptr<QIODevice> &plainText_) +static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread *thread, + const std::weak_ptr<QIODevice> &cipherText_, + const std::weak_ptr<QIODevice> &plainText_) { qCDebug(GPGPME_BACKEND_LOG); - const shared_ptr<QIODevice> cipherText = cipherText_.lock(); - const shared_ptr<QIODevice> plainText = plainText_.lock(); + const std::shared_ptr<QIODevice> cipherText = cipherText_.lock(); + const std::shared_ptr<QIODevice> plainText = plainText_.lock(); const _detail::ToThreadMover ctMover(cipherText, thread); const _detail::ToThreadMover ptMover(plainText, thread); @@ -83,7 +82,7 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); qCDebug(GPGPME_BACKEND_LOG) << "End no plainText. Error: " << ae; - return make_tuple(res.first, res.second, out.data(), log, ae); + return std::make_tuple(res.first, res.second, out.data(), log, ae); } else { QGpgME::QIODeviceDataProvider out(plainText); Data outdata(&out); @@ -92,19 +91,19 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); qCDebug(GPGPME_BACKEND_LOG) << "End plainText. Error: " << ae; - return make_tuple(res.first, res.second, QByteArray(), log, ae); + return std::make_tuple(res.first, res.second, QByteArray(), log, ae); } } static QGpgMEDecryptVerifyJob::result_type decrypt_verify_qba(Context *ctx, const QByteArray &cipherText) { - const shared_ptr<QBuffer> buffer(new QBuffer); + const std::shared_ptr<QBuffer> buffer(new QBuffer); buffer->setData(cipherText); if (!buffer->open(QIODevice::ReadOnly)) { assert(!"This should never happen: QBuffer::open() failed"); } - return decrypt_verify(ctx, 0, buffer, shared_ptr<QIODevice>()); + return decrypt_verify(ctx, 0, buffer, std::shared_ptr<QIODevice>()); } Error QGpgMEDecryptVerifyJob::start(const QByteArray &cipherText) @@ -113,7 +112,7 @@ Error QGpgMEDecryptVerifyJob::start(const QByteArray &cipherText) return Error(); } -void QGpgMEDecryptVerifyJob::start(const shared_ptr<QIODevice> &cipherText, const shared_ptr<QIODevice> &plainText) +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); } @@ -122,7 +121,7 @@ std::pair<GpgME::DecryptionResult, GpgME::VerificationResult> QGpgME::QGpgMEDecryptVerifyJob::exec(const QByteArray &cipherText, QByteArray &plainText) { const result_type r = decrypt_verify_qba(context(), cipherText); - plainText = get<2>(r); + plainText = std::get<2>(r); resultHook(r); return mResult; } @@ -131,6 +130,6 @@ QGpgME::QGpgMEDecryptVerifyJob::exec(const QByteArray &cipherText, QByteArray &p void QGpgMEDecryptVerifyJob::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 "qgpgmedecryptverifyjob.moc" diff --git a/lang/qt/src/qgpgmedecryptverifyjob.h b/lang/qt/src/qgpgmedecryptverifyjob.h index 37b8e1ed..0e67de59 100644 --- a/lang/qt/src/qgpgmedecryptverifyjob.h +++ b/lang/qt/src/qgpgmedecryptverifyjob.h @@ -56,7 +56,7 @@ class QGpgMEDecryptVerifyJob #ifdef Q_MOC_RUN : public DecryptVerifyJob #else - : public _detail::ThreadedJobMixin<DecryptVerifyJob, boost::tuple<GpgME::DecryptionResult, GpgME::VerificationResult, QByteArray, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<DecryptVerifyJob, std::tuple<GpgME::DecryptionResult, GpgME::VerificationResult, QByteArray, QString, GpgME::Error> > #endif { Q_OBJECT @@ -72,7 +72,7 @@ public: GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE; /*! \reimp from DecryptVerifyJob */ - void start(const boost::shared_ptr<QIODevice> &cipherText, const boost::shared_ptr<QIODevice> &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText) Q_DECL_OVERRIDE; /*! \reimp from DecryptVerifyJob */ std::pair<GpgME::DecryptionResult, GpgME::VerificationResult> diff --git a/lang/qt/src/qgpgmedeletejob.cpp b/lang/qt/src/qgpgmedeletejob.cpp index 8ec4f0a3..4b2f83a3 100644 --- a/lang/qt/src/qgpgmedeletejob.cpp +++ b/lang/qt/src/qgpgmedeletejob.cpp @@ -55,7 +55,7 @@ static QGpgMEDeleteJob::result_type delete_key(Context *ctx, const Key &key, boo const Error err = ctx->deleteKey(key, allowSecretKeyDeletion); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(err, log, ae); + return std::make_tuple(err, log, ae); } Error QGpgMEDeleteJob::start(const Key &key, bool allowSecretKeyDeletion) diff --git a/lang/qt/src/qgpgmedownloadjob.cpp b/lang/qt/src/qgpgmedownloadjob.cpp index f46f4282..4f9eea2b 100644 --- a/lang/qt/src/qgpgmedownloadjob.cpp +++ b/lang/qt/src/qgpgmedownloadjob.cpp @@ -40,13 +40,10 @@ #include <QStringList> -#include <boost/weak_ptr.hpp> - #include <cassert> using namespace QGpgME; using namespace GpgME; -using namespace boost; QGpgMEDownloadJob::QGpgMEDownloadJob(Context *context) : mixin_type(context) @@ -66,12 +63,12 @@ static QGpgMEDownloadJob::result_type download_qsl(Context *ctx, const QStringLi const Error err = ctx->exportPublicKeys(pc.patterns(), data); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(err, dp.data(), log, ae); + return std::make_tuple(err, dp.data(), log, ae); } -static QGpgMEDownloadJob::result_type download(Context *ctx, QThread *thread, const QByteArray &fpr, const weak_ptr<QIODevice> &keyData_) +static QGpgMEDownloadJob::result_type download(Context *ctx, QThread *thread, const QByteArray &fpr, const std::weak_ptr<QIODevice> &keyData_) { - const shared_ptr<QIODevice> keyData = keyData_.lock(); + const std::shared_ptr<QIODevice> keyData = keyData_.lock(); if (!keyData) { return download_qsl(ctx, QStringList(QString::fromUtf8(fpr))); } @@ -86,7 +83,7 @@ static QGpgMEDownloadJob::result_type download(Context *ctx, QThread *thread, co const Error err = ctx->exportPublicKeys(pc.patterns(), data); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(err, QByteArray(), log, ae); + return std::make_tuple(err, QByteArray(), log, ae); } Error QGpgMEDownloadJob::start(const QStringList &pats) @@ -95,7 +92,7 @@ Error QGpgMEDownloadJob::start(const QStringList &pats) return Error(); } -Error QGpgMEDownloadJob::start(const QByteArray &fpr, const boost::shared_ptr<QIODevice> &keyData) +Error QGpgMEDownloadJob::start(const QByteArray &fpr, const std::shared_ptr<QIODevice> &keyData) { run(bind(&download, _1, _2, fpr, _3), keyData); return Error(); diff --git a/lang/qt/src/qgpgmedownloadjob.h b/lang/qt/src/qgpgmedownloadjob.h index 58fe7f91..979481e3 100644 --- a/lang/qt/src/qgpgmedownloadjob.h +++ b/lang/qt/src/qgpgmedownloadjob.h @@ -45,7 +45,7 @@ class QGpgMEDownloadJob #ifdef Q_MOC_RUN : public DownloadJob #else - : public _detail::ThreadedJobMixin<DownloadJob, boost::tuple<GpgME::Error, QByteArray, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<DownloadJob, std::tuple<GpgME::Error, QByteArray, QString, GpgME::Error> > #endif { Q_OBJECT @@ -61,7 +61,7 @@ public: GpgME::Error start(const QStringList &fingerprints) Q_DECL_OVERRIDE; /*! \reimp from DownloadJob */ - GpgME::Error start(const QByteArray &fingerprint, const boost::shared_ptr<QIODevice> &keyData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &fingerprint, const std::shared_ptr<QIODevice> &keyData) Q_DECL_OVERRIDE; }; } diff --git a/lang/qt/src/qgpgmeencryptjob.cpp b/lang/qt/src/qgpgmeencryptjob.cpp index 97406dd9..df8ae7d2 100644 --- a/lang/qt/src/qgpgmeencryptjob.cpp +++ b/lang/qt/src/qgpgmeencryptjob.cpp @@ -65,14 +65,14 @@ void QGpgMEEncryptJob::setOutputIsBase64Encoded(bool on) static QGpgMEEncryptJob::result_type encrypt(Context *ctx, QThread *thread, const std::vector<Key> &recipients, - const weak_ptr<QIODevice> &plainText_, - const weak_ptr<QIODevice> &cipherText_, + const std::weak_ptr<QIODevice> &plainText_, + const std::weak_ptr<QIODevice> &cipherText_, bool alwaysTrust, bool outputIsBsse64Encoded) { - const shared_ptr<QIODevice> plainText = plainText_.lock(); - const shared_ptr<QIODevice> cipherText = cipherText_.lock(); + const std::shared_ptr<QIODevice> plainText = plainText_.lock(); + const std::shared_ptr<QIODevice> cipherText = cipherText_.lock(); const _detail::ToThreadMover ctMover(cipherText, thread); const _detail::ToThreadMover ptMover(plainText, thread); @@ -94,7 +94,7 @@ static QGpgMEEncryptJob::result_type encrypt(Context *ctx, QThread *thread, const EncryptionResult res = ctx->encrypt(recipients, indata, outdata, eflags); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, out.data(), log, ae); + return std::make_tuple(res, out.data(), log, ae); } else { QGpgME::QIODeviceDataProvider out(cipherText); Data outdata(&out); @@ -106,19 +106,19 @@ static QGpgMEEncryptJob::result_type encrypt(Context *ctx, QThread *thread, const EncryptionResult res = ctx->encrypt(recipients, indata, outdata, eflags); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, QByteArray(), log, ae); + return std::make_tuple(res, QByteArray(), log, ae); } } static QGpgMEEncryptJob::result_type encrypt_qba(Context *ctx, const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust, bool outputIsBsse64Encoded) { - const shared_ptr<QBuffer> buffer(new QBuffer); + const std::shared_ptr<QBuffer> buffer(new QBuffer); buffer->setData(plainText); if (!buffer->open(QIODevice::ReadOnly)) { assert(!"This should never happen: QBuffer::open() failed"); } - return encrypt(ctx, 0, recipients, buffer, shared_ptr<QIODevice>(), alwaysTrust, outputIsBsse64Encoded); + return encrypt(ctx, 0, recipients, buffer, std::shared_ptr<QIODevice>(), alwaysTrust, outputIsBsse64Encoded); } Error QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust) @@ -127,7 +127,7 @@ Error QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const QByteArr return Error(); } -void QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const shared_ptr<QIODevice> &plainText, const shared_ptr<QIODevice> &cipherText, bool alwaysTrust) +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, diff --git a/lang/qt/src/qgpgmeencryptjob.h b/lang/qt/src/qgpgmeencryptjob.h index ff9b7a93..ea0cd428 100644 --- a/lang/qt/src/qgpgmeencryptjob.h +++ b/lang/qt/src/qgpgmeencryptjob.h @@ -56,7 +56,7 @@ class QGpgMEEncryptJob #ifdef Q_MOC_RUN : public EncryptJob #else - : public _detail::ThreadedJobMixin<EncryptJob, boost::tuple<GpgME::EncryptionResult, QByteArray, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<EncryptJob, std::tuple<GpgME::EncryptionResult, QByteArray, QString, GpgME::Error> > #endif { Q_OBJECT @@ -74,8 +74,8 @@ public: /*! \reimp from EncryptJob */ void start(const std::vector<GpgME::Key> &recipients, - const boost::shared_ptr<QIODevice> &plainText, - const boost::shared_ptr<QIODevice> &cipherText, + const std::shared_ptr<QIODevice> &plainText, + const std::shared_ptr<QIODevice> &cipherText, bool alwaysTrust) Q_DECL_OVERRIDE; /*! \reimp from EncryptJob */ @@ -83,9 +83,6 @@ public: const QByteArray &plainText, bool alwaysTrust, QByteArray &cipherText) Q_DECL_OVERRIDE; - /*! \reimp from Job */ - void showErrorDialog(QWidget *parent, const QString &caption) const Q_DECL_OVERRIDE; - /*! \reimp from EncryptJob */ void setOutputIsBase64Encoded(bool on) Q_DECL_OVERRIDE; diff --git a/lang/qt/src/qgpgmeexportjob.cpp b/lang/qt/src/qgpgmeexportjob.cpp index d3a390e4..56584faf 100644 --- a/lang/qt/src/qgpgmeexportjob.cpp +++ b/lang/qt/src/qgpgmeexportjob.cpp @@ -66,7 +66,7 @@ static QGpgMEExportJob::result_type export_qba(Context *ctx, const QStringList & const Error err = ctx->exportPublicKeys(pc.patterns(), data); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(err, dp.data(), log, ae); + return std::make_tuple(err, dp.data(), log, ae); } Error QGpgMEExportJob::start(const QStringList &patterns) diff --git a/lang/qt/src/qgpgmeexportjob.h b/lang/qt/src/qgpgmeexportjob.h index 4606b3ea..9404d875 100644 --- a/lang/qt/src/qgpgmeexportjob.h +++ b/lang/qt/src/qgpgmeexportjob.h @@ -45,7 +45,7 @@ class QGpgMEExportJob #ifdef Q_MOC_RUN : public ExportJob #else - : public _detail::ThreadedJobMixin<ExportJob, boost::tuple<GpgME::Error, QByteArray, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<ExportJob, std::tuple<GpgME::Error, QByteArray, QString, GpgME::Error> > #endif { Q_OBJECT diff --git a/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp b/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp index ecf78797..a223aacf 100644 --- a/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp +++ b/lang/qt/src/qgpgmeimportfromkeyserverjob.cpp @@ -58,7 +58,7 @@ static QGpgMEImportFromKeyserverJob::result_type importfromkeyserver(Context *ct const ImportResult res = ctx->importKeys(keys); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, log, ae); + return std::make_tuple(res, log, ae); } Error QGpgMEImportFromKeyserverJob::start(const std::vector<Key> &keys) diff --git a/lang/qt/src/qgpgmeimportfromkeyserverjob.h b/lang/qt/src/qgpgmeimportfromkeyserverjob.h index 508aa099..8c93a415 100644 --- a/lang/qt/src/qgpgmeimportfromkeyserverjob.h +++ b/lang/qt/src/qgpgmeimportfromkeyserverjob.h @@ -51,7 +51,7 @@ class QGpgMEImportFromKeyserverJob #ifdef Q_MOC_RUN : public ImportFromKeyserverJob #else - : public _detail::ThreadedJobMixin<ImportFromKeyserverJob, boost::tuple<GpgME::ImportResult, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<ImportFromKeyserverJob, std::tuple<GpgME::ImportResult, QString, GpgME::Error> > #endif { Q_OBJECT diff --git a/lang/qt/src/qgpgmeimportjob.cpp b/lang/qt/src/qgpgmeimportjob.cpp index 0e44cbe8..f76fc7d3 100644 --- a/lang/qt/src/qgpgmeimportjob.cpp +++ b/lang/qt/src/qgpgmeimportjob.cpp @@ -61,7 +61,7 @@ static QGpgMEImportJob::result_type import_qba(Context *ctx, const QByteArray &c const ImportResult res = ctx->importKeys(data); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, log, ae); + return std::make_tuple(res, log, ae); } Error QGpgMEImportJob::start(const QByteArray &certData) diff --git a/lang/qt/src/qgpgmeimportjob.h b/lang/qt/src/qgpgmeimportjob.h index e023c694..38581977 100644 --- a/lang/qt/src/qgpgmeimportjob.h +++ b/lang/qt/src/qgpgmeimportjob.h @@ -51,7 +51,7 @@ class QGpgMEImportJob #ifdef Q_MOC_RUN : public ImportJob #else - : public _detail::ThreadedJobMixin<ImportJob, boost::tuple<GpgME::ImportResult, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<ImportJob, std::tuple<GpgME::ImportResult, QString, GpgME::Error> > #endif { Q_OBJECT diff --git a/lang/qt/src/qgpgmekeygenerationjob.cpp b/lang/qt/src/qgpgmekeygenerationjob.cpp index fc7cf159..ad2904e2 100644 --- a/lang/qt/src/qgpgmekeygenerationjob.cpp +++ b/lang/qt/src/qgpgmekeygenerationjob.cpp @@ -61,7 +61,7 @@ static QGpgMEKeyGenerationJob::result_type generate_key(Context *ctx, const QStr const KeyGenerationResult res = ctx->generateKey(parameters.toUtf8().constData(), data); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, dp.data(), log, ae); + return std::make_tuple(res, dp.data(), log, ae); } Error QGpgMEKeyGenerationJob::start(const QString ¶meters) diff --git a/lang/qt/src/qgpgmekeygenerationjob.h b/lang/qt/src/qgpgmekeygenerationjob.h index 62039601..520ad4ca 100644 --- a/lang/qt/src/qgpgmekeygenerationjob.h +++ b/lang/qt/src/qgpgmekeygenerationjob.h @@ -51,7 +51,7 @@ class QGpgMEKeyGenerationJob #ifdef Q_MOC_RUN : public KeyGenerationJob #else - : public _detail::ThreadedJobMixin<KeyGenerationJob, boost::tuple<GpgME::KeyGenerationResult, QByteArray, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<KeyGenerationJob, std::tuple<GpgME::KeyGenerationResult, QByteArray, QString, GpgME::Error> > #endif { Q_OBJECT diff --git a/lang/qt/src/qgpgmekeylistjob.cpp b/lang/qt/src/qgpgmekeylistjob.cpp index 2af45fe7..61da5be5 100644 --- a/lang/qt/src/qgpgmekeylistjob.cpp +++ b/lang/qt/src/qgpgmekeylistjob.cpp @@ -85,7 +85,7 @@ static QGpgMEKeyListJob::result_type list_keys(Context *ctx, QStringList pats, b if (pats.size() < 2) { std::vector<Key> keys; const KeyListResult r = do_list_keys(ctx, pats, keys, secretOnly); - return boost::make_tuple(r, keys, QString(), Error()); + return std::make_tuple(r, keys, QString(), Error()); } // The communication channel between gpgme and gpgsm is limited in @@ -110,14 +110,14 @@ retry: if (chunkSize < 1) // chunks smaller than one can't be -> return the error. { - return boost::make_tuple(this_result, keys, QString(), Error()); + return std::make_tuple(this_result, keys, QString(), Error()); } else { goto retry; } } else if (this_result.error().code() == GPG_ERR_EOF) { // early end of keylisting (can happen when ~/.gnupg doesn't // exist). Fakeing an empty result: - return boost::make_tuple(KeyListResult(), std::vector<Key>(), QString(), Error()); + return std::make_tuple(KeyListResult(), std::vector<Key>(), QString(), Error()); } // ok, that seemed to work... result.mergeWith(this_result); @@ -126,7 +126,7 @@ retry: } pats = pats.mid(chunkSize); } while (!pats.empty()); - return boost::make_tuple(result, keys, QString(), Error()); + return std::make_tuple(result, keys, QString(), Error()); } Error QGpgMEKeyListJob::start(const QStringList &patterns, bool secretOnly) diff --git a/lang/qt/src/qgpgmekeylistjob.h b/lang/qt/src/qgpgmekeylistjob.h index 860bb3ed..fd881d96 100644 --- a/lang/qt/src/qgpgmekeylistjob.h +++ b/lang/qt/src/qgpgmekeylistjob.h @@ -56,7 +56,7 @@ class QGpgMEKeyListJob #ifdef Q_MOC_RUN : public KeyListJob #else - : public _detail::ThreadedJobMixin<KeyListJob, boost::tuple<GpgME::KeyListResult, std::vector<GpgME::Key>, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<KeyListJob, std::tuple<GpgME::KeyListResult, std::vector<GpgME::Key>, QString, GpgME::Error> > #endif { Q_OBJECT @@ -74,9 +74,6 @@ public: /*! \reimp from KeyListJob */ GpgME::KeyListResult exec(const QStringList &patterns, bool secretOnly, std::vector<GpgME::Key> &keys) Q_DECL_OVERRIDE; - /*! \reimp from Job */ - void showErrorDialog(QWidget *parent, const QString &caption) const Q_DECL_OVERRIDE; - /*! \reimp from ThreadedJobMixin */ void resultHook(const result_type &result) Q_DECL_OVERRIDE; diff --git a/lang/qt/src/qgpgmelistallkeysjob.cpp b/lang/qt/src/qgpgmelistallkeysjob.cpp index 4f98d34a..8b664146 100644 --- a/lang/qt/src/qgpgmelistallkeysjob.cpp +++ b/lang/qt/src/qgpgmelistallkeysjob.cpp @@ -132,7 +132,7 @@ static QGpgMEListAllKeysJob::result_type list_keys(Context *ctx, bool mergeKeys) } else { merged.swap(pub); } - return boost::make_tuple(r, merged, sec, QString(), Error()); + return std::make_tuple(r, merged, sec, QString(), Error()); } Error QGpgMEListAllKeysJob::start(bool mergeKeys) diff --git a/lang/qt/src/qgpgmelistallkeysjob.h b/lang/qt/src/qgpgmelistallkeysjob.h index f7aabf5c..50747f4b 100644 --- a/lang/qt/src/qgpgmelistallkeysjob.h +++ b/lang/qt/src/qgpgmelistallkeysjob.h @@ -56,7 +56,7 @@ class QGpgMEListAllKeysJob #ifdef Q_MOC_RUN : public ListAllKeysJob #else - : public _detail::ThreadedJobMixin<ListAllKeysJob, boost::tuple<GpgME::KeyListResult, std::vector<GpgME::Key>, std::vector<GpgME::Key>, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<ListAllKeysJob, std::tuple<GpgME::KeyListResult, std::vector<GpgME::Key>, std::vector<GpgME::Key>, QString, GpgME::Error> > #endif { Q_OBJECT diff --git a/lang/qt/src/qgpgmenewcryptoconfig.cpp b/lang/qt/src/qgpgmenewcryptoconfig.cpp index 13017d6a..a187360f 100644 --- a/lang/qt/src/qgpgmenewcryptoconfig.cpp +++ b/lang/qt/src/qgpgmenewcryptoconfig.cpp @@ -109,7 +109,7 @@ void QGpgMENewCryptoConfig::reloadConfiguration(bool showErrors) } #endif BOOST_FOREACH(const Component & c, components) { - const shared_ptr<QGpgMENewCryptoConfigComponent> comp(new QGpgMENewCryptoConfigComponent); + const std::shared_ptr<QGpgMENewCryptoConfigComponent> comp(new QGpgMENewCryptoConfigComponent); comp->setComponent(c); m_componentsByName[ comp->name() ] = comp; } @@ -138,7 +138,7 @@ QGpgMENewCryptoConfigComponent *QGpgMENewCryptoConfig::component(const QString & void QGpgMENewCryptoConfig::sync(bool runtime) { - BOOST_FOREACH(const shared_ptr<QGpgMENewCryptoConfigComponent> &c, m_componentsByName) + BOOST_FOREACH(const std::shared_ptr<QGpgMENewCryptoConfigComponent> &c, m_componentsByName) c->sync(runtime); } @@ -164,7 +164,7 @@ void QGpgMENewCryptoConfigComponent::setComponent(const Component &component) m_component = component; m_groupsByName.clear(); - shared_ptr<QGpgMENewCryptoConfigGroup> group; + std::shared_ptr<QGpgMENewCryptoConfigGroup> group; const std::vector<Option> options = m_component.options(); BOOST_FOREACH(const Option & o, options) @@ -174,7 +174,7 @@ void QGpgMENewCryptoConfigComponent::setComponent(const Component &component) } group.reset(new QGpgMENewCryptoConfigGroup(shared_from_this(), o)); } else if (group) { - const shared_ptr<QGpgMENewCryptoConfigEntry> entry(new QGpgMENewCryptoConfigEntry(group, o)); + const std::shared_ptr<QGpgMENewCryptoConfigEntry> entry(new QGpgMENewCryptoConfigEntry(group, o)); const QString name = entry->name(); group->m_entryNames.push_back(name); group->m_entriesByName[name] = entry; @@ -231,7 +231,7 @@ void QGpgMENewCryptoConfigComponent::sync(bool runtime) //// -QGpgMENewCryptoConfigGroup::QGpgMENewCryptoConfigGroup(const shared_ptr<QGpgMENewCryptoConfigComponent> &comp, const Option &option) +QGpgMENewCryptoConfigGroup::QGpgMENewCryptoConfigGroup(const std::shared_ptr<QGpgMENewCryptoConfigComponent> &comp, const Option &option) : CryptoConfigGroup(), m_component(comp), m_option(option) @@ -252,7 +252,7 @@ QString QGpgMENewCryptoConfigGroup::description() const QString QGpgMENewCryptoConfigGroup::path() const { - if (const shared_ptr<QGpgMENewCryptoConfigComponent> c = m_component.lock()) { + if (const std::shared_ptr<QGpgMENewCryptoConfigComponent> c = m_component.lock()) { return c->name() + QLatin1Char('/') + name(); } else { return QString(); @@ -312,7 +312,7 @@ static QGpgME::CryptoConfigEntry::ArgType knownArgType(int argType, bool &ok) } } -QGpgMENewCryptoConfigEntry::QGpgMENewCryptoConfigEntry(const shared_ptr<QGpgMENewCryptoConfigGroup> &group, const Option &option) +QGpgMENewCryptoConfigEntry::QGpgMENewCryptoConfigEntry(const std::shared_ptr<QGpgMENewCryptoConfigGroup> &group, const Option &option) : m_group(group), m_option(option) { } @@ -387,7 +387,7 @@ QString QGpgMENewCryptoConfigEntry::description() const QString QGpgMENewCryptoConfigEntry::path() const { - if (const shared_ptr<QGpgMENewCryptoConfigGroup> g = m_group.lock()) { + if (const std::shared_ptr<QGpgMENewCryptoConfigGroup> g = m_group.lock()) { return g->path() + QLatin1Char('/') + name(); } else { return QString(); diff --git a/lang/qt/src/qgpgmenewcryptoconfig.h b/lang/qt/src/qgpgmenewcryptoconfig.h index 0afe3811..be184ac9 100644 --- a/lang/qt/src/qgpgmenewcryptoconfig.h +++ b/lang/qt/src/qgpgmenewcryptoconfig.h @@ -62,7 +62,7 @@ class QGpgMENewCryptoConfigEntry; class QGpgMENewCryptoConfigEntry : public QGpgME::CryptoConfigEntry { public: - QGpgMENewCryptoConfigEntry(const boost::shared_ptr<QGpgMENewCryptoConfigGroup> &group, const GpgME::Configuration::Option &option); + QGpgMENewCryptoConfigEntry(const std::shared_ptr<QGpgMENewCryptoConfigGroup> &group, const GpgME::Configuration::Option &option); ~QGpgMENewCryptoConfigEntry(); QString name() const Q_DECL_OVERRIDE; @@ -106,14 +106,14 @@ protected: QString toString(bool escape) const; #endif private: - boost::weak_ptr<QGpgMENewCryptoConfigGroup> m_group; + std::weak_ptr<QGpgMENewCryptoConfigGroup> m_group; GpgME::Configuration::Option m_option; }; class QGpgMENewCryptoConfigGroup : public QGpgME::CryptoConfigGroup { public: - QGpgMENewCryptoConfigGroup(const boost::shared_ptr<QGpgMENewCryptoConfigComponent> &parent, const GpgME::Configuration::Option &option); + QGpgMENewCryptoConfigGroup(const std::shared_ptr<QGpgMENewCryptoConfigComponent> &parent, const GpgME::Configuration::Option &option); ~QGpgMENewCryptoConfigGroup(); QString name() const Q_DECL_OVERRIDE; @@ -129,14 +129,14 @@ public: private: friend class QGpgMENewCryptoConfigComponent; // it adds the entries - boost::weak_ptr<QGpgMENewCryptoConfigComponent> m_component; + std::weak_ptr<QGpgMENewCryptoConfigComponent> m_component; GpgME::Configuration::Option m_option; QStringList m_entryNames; - QHash< QString, boost::shared_ptr<QGpgMENewCryptoConfigEntry> > m_entriesByName; + QHash< QString, std::shared_ptr<QGpgMENewCryptoConfigEntry> > m_entriesByName; }; /// For docu, see kleo/cryptoconfig.h -class QGpgMENewCryptoConfigComponent : public QGpgME::CryptoConfigComponent, public boost::enable_shared_from_this<QGpgMENewCryptoConfigComponent> +class QGpgMENewCryptoConfigComponent : public QGpgME::CryptoConfigComponent, public std::enable_shared_from_this<QGpgMENewCryptoConfigComponent> { public: QGpgMENewCryptoConfigComponent(); @@ -157,7 +157,7 @@ public: private: GpgME::Configuration::Component m_component; - QHash< QString, boost::shared_ptr<QGpgMENewCryptoConfigGroup> > m_groupsByName; + QHash< QString, std::shared_ptr<QGpgMENewCryptoConfigGroup> > m_groupsByName; }; /** @@ -185,7 +185,7 @@ private: void reloadConfiguration(bool showErrors); private: - QHash< QString, boost::shared_ptr<QGpgMENewCryptoConfigComponent> > m_componentsByName; + QHash< QString, std::shared_ptr<QGpgMENewCryptoConfigComponent> > m_componentsByName; bool m_parsed; }; diff --git a/lang/qt/src/qgpgmesignencryptjob.cpp b/lang/qt/src/qgpgmesignencryptjob.cpp index 7c184c6c..16949d7d 100644 --- a/lang/qt/src/qgpgmesignencryptjob.cpp +++ b/lang/qt/src/qgpgmesignencryptjob.cpp @@ -64,10 +64,10 @@ void QGpgMESignEncryptJob::setOutputIsBase64Encoded(bool on) mOutputIsBase64Encoded = on; } -static QGpgMESignEncryptJob::result_type sign_encrypt(Context *ctx, QThread *thread, const std::vector<Key> &signers, const std::vector<Key> &recipients, const weak_ptr<QIODevice> &plainText_, const weak_ptr<QIODevice> &cipherText_, bool alwaysTrust, bool outputIsBsse64Encoded) +static QGpgMESignEncryptJob::result_type sign_encrypt(Context *ctx, QThread *thread, const std::vector<Key> &signers, const std::vector<Key> &recipients, const std::weak_ptr<QIODevice> &plainText_, const std::weak_ptr<QIODevice> &cipherText_, bool alwaysTrust, bool outputIsBsse64Encoded) { - const shared_ptr<QIODevice> &plainText = plainText_.lock(); - const shared_ptr<QIODevice> &cipherText = cipherText_.lock(); + const std::shared_ptr<QIODevice> &plainText = plainText_.lock(); + const std::shared_ptr<QIODevice> &cipherText = cipherText_.lock(); const _detail::ToThreadMover ctMover(cipherText, thread); const _detail::ToThreadMover ptMover(plainText, thread); @@ -82,7 +82,7 @@ static QGpgMESignEncryptJob::result_type sign_encrypt(Context *ctx, QThread *thr Q_FOREACH (const Key &signer, signers) if (!signer.isNull()) if (const Error err = ctx->addSigningKey(signer)) { - return make_tuple(SigningResult(err), EncryptionResult(), QByteArray(), QString(), Error()); + return std::make_tuple(SigningResult(err), EncryptionResult(), QByteArray(), QString(), Error()); } if (!cipherText) { @@ -96,7 +96,7 @@ static QGpgMESignEncryptJob::result_type sign_encrypt(Context *ctx, QThread *thr const std::pair<SigningResult, EncryptionResult> res = ctx->signAndEncrypt(recipients, indata, outdata, eflags); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res.first, res.second, out.data(), log, ae); + return std::make_tuple(res.first, res.second, out.data(), log, ae); } else { QGpgME::QIODeviceDataProvider out(cipherText); Data outdata(&out); @@ -108,19 +108,19 @@ static QGpgMESignEncryptJob::result_type sign_encrypt(Context *ctx, QThread *thr const std::pair<SigningResult, EncryptionResult> res = ctx->signAndEncrypt(recipients, indata, outdata, eflags); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res.first, res.second, QByteArray(), log, ae); + return std::make_tuple(res.first, res.second, QByteArray(), log, ae); } } static QGpgMESignEncryptJob::result_type sign_encrypt_qba(Context *ctx, const std::vector<Key> &signers, const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust, bool outputIsBsse64Encoded) { - const shared_ptr<QBuffer> buffer(new QBuffer); + const std::shared_ptr<QBuffer> buffer(new QBuffer); buffer->setData(plainText); if (!buffer->open(QIODevice::ReadOnly)) { assert(!"This should never happen: QBuffer::open() failed"); } - return sign_encrypt(ctx, 0, signers, recipients, buffer, shared_ptr<QIODevice>(), alwaysTrust, outputIsBsse64Encoded); + return sign_encrypt(ctx, 0, signers, recipients, buffer, std::shared_ptr<QIODevice>(), alwaysTrust, outputIsBsse64Encoded); } Error QGpgMESignEncryptJob::start(const std::vector<Key> &signers, const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust) @@ -129,7 +129,7 @@ Error QGpgMESignEncryptJob::start(const std::vector<Key> &signers, const std::ve return Error(); } -void QGpgMESignEncryptJob::start(const std::vector<Key> &signers, const std::vector<Key> &recipients, const shared_ptr<QIODevice> &plainText, const shared_ptr<QIODevice> &cipherText, bool alwaysTrust) +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); } diff --git a/lang/qt/src/qgpgmesignencryptjob.h b/lang/qt/src/qgpgmesignencryptjob.h index d04661aa..bfdcbb61 100644 --- a/lang/qt/src/qgpgmesignencryptjob.h +++ b/lang/qt/src/qgpgmesignencryptjob.h @@ -63,7 +63,7 @@ class QGpgMESignEncryptJob #ifdef Q_MOC_RUN : public SignEncryptJob #else - : public _detail::ThreadedJobMixin<SignEncryptJob, boost::tuple<GpgME::SigningResult, GpgME::EncryptionResult, QByteArray, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<SignEncryptJob, std::tuple<GpgME::SigningResult, GpgME::EncryptionResult, QByteArray, QString, GpgME::Error> > #endif { Q_OBJECT @@ -83,8 +83,8 @@ public: /*! \reimp from SignEncryptJob */ void start(const std::vector<GpgME::Key> &signers, const std::vector<GpgME::Key> &recipients, - const boost::shared_ptr<QIODevice> &plainText, - const boost::shared_ptr<QIODevice> &cipherText, + const std::shared_ptr<QIODevice> &plainText, + const std::shared_ptr<QIODevice> &cipherText, bool alwaysTrust) Q_DECL_OVERRIDE; std::pair<GpgME::SigningResult, GpgME::EncryptionResult> diff --git a/lang/qt/src/qgpgmesignjob.cpp b/lang/qt/src/qgpgmesignjob.cpp index 3fdf3e61..1b05b862 100644 --- a/lang/qt/src/qgpgmesignjob.cpp +++ b/lang/qt/src/qgpgmesignjob.cpp @@ -65,14 +65,14 @@ void QGpgMESignJob::setOutputIsBase64Encoded(bool on) static QGpgMESignJob::result_type sign(Context *ctx, QThread *thread, const std::vector<Key> &signers, - const weak_ptr<QIODevice> &plainText_, - const weak_ptr<QIODevice> &signature_, + const std::weak_ptr<QIODevice> &plainText_, + const std::weak_ptr<QIODevice> &signature_, SignatureMode mode, bool outputIsBsse64Encoded) { - const shared_ptr<QIODevice> plainText = plainText_.lock(); - const shared_ptr<QIODevice> signature = signature_.lock(); + const std::shared_ptr<QIODevice> plainText = plainText_.lock(); + const std::shared_ptr<QIODevice> signature = signature_.lock(); const _detail::ToThreadMover ptMover(plainText, thread); const _detail::ToThreadMover sgMover(signature, thread); @@ -84,7 +84,7 @@ static QGpgMESignJob::result_type sign(Context *ctx, QThread *thread, Q_FOREACH (const Key &signer, signers) if (!signer.isNull()) if (const Error err = ctx->addSigningKey(signer)) { - return make_tuple(SigningResult(err), QByteArray(), QString(), Error()); + return std::make_tuple(SigningResult(err), QByteArray(), QString(), Error()); } if (!signature) { @@ -98,7 +98,7 @@ static QGpgMESignJob::result_type sign(Context *ctx, QThread *thread, const SigningResult res = ctx->sign(indata, outdata, mode); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, out.data(), log, ae); + return std::make_tuple(res, out.data(), log, ae); } else { QGpgME::QIODeviceDataProvider out(signature); Data outdata(&out); @@ -110,7 +110,7 @@ static QGpgMESignJob::result_type sign(Context *ctx, QThread *thread, const SigningResult res = ctx->sign(indata, outdata, mode); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, QByteArray(), log, ae); + return std::make_tuple(res, QByteArray(), log, ae); } } @@ -121,12 +121,12 @@ static QGpgMESignJob::result_type sign_qba(Context *ctx, SignatureMode mode, bool outputIsBsse64Encoded) { - const shared_ptr<QBuffer> buffer(new QBuffer); + const std::shared_ptr<QBuffer> buffer(new QBuffer); buffer->setData(plainText); if (!buffer->open(QIODevice::ReadOnly)) { assert(!"This should never happen: QBuffer::open() failed"); } - return sign(ctx, 0, signers, buffer, shared_ptr<QIODevice>(), mode, outputIsBsse64Encoded); + return sign(ctx, 0, signers, buffer, std::shared_ptr<QIODevice>(), mode, outputIsBsse64Encoded); } Error QGpgMESignJob::start(const std::vector<Key> &signers, const QByteArray &plainText, SignatureMode mode) @@ -135,7 +135,7 @@ Error QGpgMESignJob::start(const std::vector<Key> &signers, const QByteArray &pl return Error(); } -void QGpgMESignJob::start(const std::vector<Key> &signers, const shared_ptr<QIODevice> &plainText, const shared_ptr<QIODevice> &signature, SignatureMode mode) +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); } diff --git a/lang/qt/src/qgpgmesignjob.h b/lang/qt/src/qgpgmesignjob.h index 2f574f8e..95f117ce 100644 --- a/lang/qt/src/qgpgmesignjob.h +++ b/lang/qt/src/qgpgmesignjob.h @@ -56,7 +56,7 @@ class QGpgMESignJob #ifdef Q_MOC_RUN : public SignJob #else - : public _detail::ThreadedJobMixin<SignJob, boost::tuple<GpgME::SigningResult, QByteArray, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<SignJob, std::tuple<GpgME::SigningResult, QByteArray, QString, GpgME::Error> > #endif { Q_OBJECT @@ -75,8 +75,8 @@ public: /*! \reimp from SignJob */ void start(const std::vector<GpgME::Key> &signers, - const boost::shared_ptr<QIODevice> &plainText, - const boost::shared_ptr<QIODevice> &signature, + const std::shared_ptr<QIODevice> &plainText, + const std::shared_ptr<QIODevice> &signature, GpgME::SignatureMode mode) Q_DECL_OVERRIDE; /*! \reimp from SignJob */ diff --git a/lang/qt/src/qgpgmesignkeyjob.cpp b/lang/qt/src/qgpgmesignkeyjob.cpp index d683e53c..743f7a0f 100644 --- a/lang/qt/src/qgpgmesignkeyjob.cpp +++ b/lang/qt/src/qgpgmesignkeyjob.cpp @@ -74,12 +74,12 @@ static QGpgMESignKeyJob::result_type sign_key(Context *ctx, const Key &key, cons if (!signer.isNull()) if (const Error err = ctx->addSigningKey(signer)) { - return make_tuple(err, QString(), Error()); + return std::make_tuple(err, QString(), Error()); } const Error err = ctx->edit(key, ei, data); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(err, log, ae); + return std::make_tuple(err, log, ae); } Error QGpgMESignKeyJob::start(const Key &key) diff --git a/lang/qt/src/qgpgmeverifydetachedjob.cpp b/lang/qt/src/qgpgmeverifydetachedjob.cpp index 3d652425..61e1c693 100644 --- a/lang/qt/src/qgpgmeverifydetachedjob.cpp +++ b/lang/qt/src/qgpgmeverifydetachedjob.cpp @@ -55,10 +55,10 @@ QGpgMEVerifyDetachedJob::QGpgMEVerifyDetachedJob(Context *context) QGpgMEVerifyDetachedJob::~QGpgMEVerifyDetachedJob() {} -static QGpgMEVerifyDetachedJob::result_type verify_detached(Context *ctx, QThread *thread, const weak_ptr<QIODevice> &signature_, const weak_ptr<QIODevice> &signedData_) +static QGpgMEVerifyDetachedJob::result_type verify_detached(Context *ctx, QThread *thread, const std::weak_ptr<QIODevice> &signature_, const std::weak_ptr<QIODevice> &signedData_) { - const shared_ptr<QIODevice> signature = signature_.lock(); - const shared_ptr<QIODevice> signedData = signedData_.lock(); + const std::shared_ptr<QIODevice> signature = signature_.lock(); + const std::shared_ptr<QIODevice> signedData = signedData_.lock(); const _detail::ToThreadMover sgMover(signature, thread); const _detail::ToThreadMover sdMover(signedData, thread); @@ -73,7 +73,7 @@ static QGpgMEVerifyDetachedJob::result_type verify_detached(Context *ctx, QThrea Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, log, ae); + return std::make_tuple(res, log, ae); } static QGpgMEVerifyDetachedJob::result_type verify_detached_qba(Context *ctx, const QByteArray &signature, const QByteArray &signedData) @@ -88,7 +88,7 @@ static QGpgMEVerifyDetachedJob::result_type verify_detached_qba(Context *ctx, co Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, log, ae); + return std::make_tuple(res, log, ae); } @@ -98,7 +98,7 @@ Error QGpgMEVerifyDetachedJob::start(const QByteArray &signature, const QByteArr return Error(); } -void QGpgMEVerifyDetachedJob::start(const shared_ptr<QIODevice> &signature, const shared_ptr<QIODevice> &signedData) +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); } diff --git a/lang/qt/src/qgpgmeverifydetachedjob.h b/lang/qt/src/qgpgmeverifydetachedjob.h index db502beb..6312d0a6 100644 --- a/lang/qt/src/qgpgmeverifydetachedjob.h +++ b/lang/qt/src/qgpgmeverifydetachedjob.h @@ -51,7 +51,7 @@ class QGpgMEVerifyDetachedJob #ifdef Q_MOC_RUN : public VerifyDetachedJob #else - : public _detail::ThreadedJobMixin<VerifyDetachedJob, boost::tuple<GpgME::VerificationResult, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<VerifyDetachedJob, std::tuple<GpgME::VerificationResult, QString, GpgME::Error> > #endif { Q_OBJECT @@ -67,7 +67,7 @@ public: GpgME::Error start(const QByteArray &signature, const QByteArray &signedData) Q_DECL_OVERRIDE; /*! \reimp from VerifyDetachedJob */ - void start(const boost::shared_ptr<QIODevice> &signature, const boost::shared_ptr<QIODevice> &signedData) Q_DECL_OVERRIDE; + void start(const std::shared_ptr<QIODevice> &signature, const std::shared_ptr<QIODevice> &signedData) Q_DECL_OVERRIDE; /*! \reimp from VerifyDetachedJob */ GpgME::VerificationResult exec(const QByteArray &signature, diff --git a/lang/qt/src/qgpgmeverifyopaquejob.cpp b/lang/qt/src/qgpgmeverifyopaquejob.cpp index fc5c1f2e..c73541b5 100644 --- a/lang/qt/src/qgpgmeverifyopaquejob.cpp +++ b/lang/qt/src/qgpgmeverifyopaquejob.cpp @@ -57,11 +57,11 @@ QGpgMEVerifyOpaqueJob::QGpgMEVerifyOpaqueJob(Context *context) QGpgMEVerifyOpaqueJob::~QGpgMEVerifyOpaqueJob() {} -static QGpgMEVerifyOpaqueJob::result_type verify_opaque(Context *ctx, QThread *thread, const weak_ptr<QIODevice> &signedData_, const weak_ptr<QIODevice> &plainText_) +static QGpgMEVerifyOpaqueJob::result_type verify_opaque(Context *ctx, QThread *thread, const std::weak_ptr<QIODevice> &signedData_, const std::weak_ptr<QIODevice> &plainText_) { - const shared_ptr<QIODevice> plainText = plainText_.lock(); - const shared_ptr<QIODevice> signedData = signedData_.lock(); + const std::shared_ptr<QIODevice> plainText = plainText_.lock(); + const std::shared_ptr<QIODevice> signedData = signedData_.lock(); const _detail::ToThreadMover ptMover(plainText, thread); const _detail::ToThreadMover sdMover(signedData, thread); @@ -76,7 +76,7 @@ static QGpgMEVerifyOpaqueJob::result_type verify_opaque(Context *ctx, QThread *t const VerificationResult res = ctx->verifyOpaqueSignature(indata, outdata); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, out.data(), log, ae); + return std::make_tuple(res, out.data(), log, ae); } else { QGpgME::QIODeviceDataProvider out(plainText); Data outdata(&out); @@ -84,19 +84,19 @@ static QGpgMEVerifyOpaqueJob::result_type verify_opaque(Context *ctx, QThread *t const VerificationResult res = ctx->verifyOpaqueSignature(indata, outdata); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - return make_tuple(res, QByteArray(), log, ae); + return std::make_tuple(res, QByteArray(), log, ae); } } static QGpgMEVerifyOpaqueJob::result_type verify_opaque_qba(Context *ctx, const QByteArray &signedData) { - const shared_ptr<QBuffer> buffer(new QBuffer); + const std::shared_ptr<QBuffer> buffer(new QBuffer); buffer->setData(signedData); if (!buffer->open(QIODevice::ReadOnly)) { assert(!"This should never happen: QBuffer::open() failed"); } - return verify_opaque(ctx, 0, buffer, shared_ptr<QIODevice>()); + return verify_opaque(ctx, 0, buffer, std::shared_ptr<QIODevice>()); } Error QGpgMEVerifyOpaqueJob::start(const QByteArray &signedData) @@ -105,7 +105,7 @@ Error QGpgMEVerifyOpaqueJob::start(const QByteArray &signedData) return Error(); } -void QGpgMEVerifyOpaqueJob::start(const shared_ptr<QIODevice> &signedData, const shared_ptr<QIODevice> &plainText) +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); } diff --git a/lang/qt/src/qgpgmeverifyopaquejob.h b/lang/qt/src/qgpgmeverifyopaquejob.h index daec5d26..434c329e 100644 --- a/lang/qt/src/qgpgmeverifyopaquejob.h +++ b/lang/qt/src/qgpgmeverifyopaquejob.h @@ -51,7 +51,7 @@ class QGpgMEVerifyOpaqueJob #ifdef Q_MOC_RUN : public VerifyOpaqueJob #else - : public _detail::ThreadedJobMixin<VerifyOpaqueJob, boost::tuple<GpgME::VerificationResult, QByteArray, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin<VerifyOpaqueJob, std::tuple<GpgME::VerificationResult, QByteArray, QString, GpgME::Error> > #endif { Q_OBJECT @@ -67,7 +67,7 @@ public: GpgME::Error start(const QByteArray &signedData) Q_DECL_OVERRIDE; /*! \reimp from VerifyOpaqueJob */ - void start(const boost::shared_ptr<QIODevice> &signedData, const boost::shared_ptr<QIODevice> &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr<QIODevice> &signedData, const std::shared_ptr<QIODevice> &plainText) Q_DECL_OVERRIDE; /*! \reimp form VerifyOpaqueJob */ GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainData) Q_DECL_OVERRIDE; diff --git a/lang/qt/src/signencryptjob.h b/lang/qt/src/signencryptjob.h index 9dba4be0..1f9b4b19 100644 --- a/lang/qt/src/signencryptjob.h +++ b/lang/qt/src/signencryptjob.h @@ -108,8 +108,8 @@ public: */ virtual void start(const std::vector<GpgME::Key> &signers, const std::vector<GpgME::Key> &recipients, - const boost::shared_ptr<QIODevice> &plainText, - const boost::shared_ptr<QIODevice> &cipherText = boost::shared_ptr<QIODevice>(), + const std::shared_ptr<QIODevice> &plainText, + const std::shared_ptr<QIODevice> &cipherText = std::shared_ptr<QIODevice>(), bool alwaysTrust = false) = 0; virtual std::pair<GpgME::SigningResult, GpgME::EncryptionResult> diff --git a/lang/qt/src/signjob.h b/lang/qt/src/signjob.h index babe4d0c..2a2e0edf 100644 --- a/lang/qt/src/signjob.h +++ b/lang/qt/src/signjob.h @@ -98,8 +98,8 @@ public: \throws GpgME::Exception if starting fails */ virtual void start(const std::vector<GpgME::Key> &signers, - const boost::shared_ptr<QIODevice> &plainText, - const boost::shared_ptr<QIODevice> &signature, + const std::shared_ptr<QIODevice> &plainText, + const std::shared_ptr<QIODevice> &signature, GpgME::SignatureMode mode) = 0; virtual GpgME::SigningResult exec(const std::vector<GpgME::Key> &signers, diff --git a/lang/qt/src/threadedjobmixin.h b/lang/qt/src/threadedjobmixin.h index 2421439c..6bea871e 100644 --- a/lang/qt/src/threadedjobmixin.h +++ b/lang/qt/src/threadedjobmixin.h @@ -86,7 +86,7 @@ class ToThreadMover 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 boost::shared_ptr<QObject> &o, QThread *t) : m_object(o.get()), m_thread(t) {} + ToThreadMover(const std::shared_ptr<QObject> &o, QThread *t) : m_object(o.get()), m_thread(t) {} ~ToThreadMover() { if (m_object && m_thread) { @@ -124,7 +124,7 @@ private: T_result m_result; }; -template <typename T_base, typename T_result = boost::tuple<GpgME::Error, QString, GpgME::Error> > +template <typename T_base, typename T_result = std::tuple<GpgME::Error, QString, GpgME::Error> > class ThreadedJobMixin : public T_base, public GpgME::ProgressProvider { public: @@ -132,20 +132,20 @@ public: typedef T_result result_type; protected: - BOOST_STATIC_ASSERT((boost::tuples::length<T_result>::value > 2)); + BOOST_STATIC_ASSERT((std::tuple_size<T_result>::value > 2)); BOOST_STATIC_ASSERT(( - boost::is_same < - typename boost::tuples::element < - boost::tuples::length<T_result>::value - 2, + std::is_same < + typename std::tuple_element < + std::tuple_size<T_result>::value - 2, T_result >::type, QString >::value )); BOOST_STATIC_ASSERT(( - boost::is_same < - typename boost::tuples::element < - boost::tuples::length<T_result>::value - 1, + std::is_same < + typename std::tuple_element < + std::tuple_size<T_result>::value - 1, T_result >::type, GpgME::Error @@ -172,7 +172,7 @@ protected: m_thread.start(); } template <typename T_binder> - void run(const T_binder &func, const boost::shared_ptr<QIODevice> &io) + void run(const T_binder &func, const std::shared_ptr<QIODevice> &io) { if (io) { io->moveToThread(&m_thread); @@ -180,12 +180,12 @@ protected: // 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 weak_ptr's to the functor. - m_thread.setFunction(boost::bind(func, this->context(), this->thread(), boost::weak_ptr<QIODevice>(io))); + // 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.start(); } template <typename T_binder> - void run(const T_binder &func, const boost::shared_ptr<QIODevice> &io1, const boost::shared_ptr<QIODevice> &io2) + void run(const T_binder &func, const std::shared_ptr<QIODevice> &io1, const std::shared_ptr<QIODevice> &io2) { if (io1) { io1->moveToThread(&m_thread); @@ -196,8 +196,8 @@ protected: // 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 weak_ptr's to the functor. - m_thread.setFunction(boost::bind(func, this->context(), this->thread(), boost::weak_ptr<QIODevice>(io1), boost::weak_ptr<QIODevice>(io2))); + // 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.start(); } GpgME::Context *context() const @@ -210,8 +210,8 @@ protected: void slotFinished() { const T_result r = m_thread.result(); - m_auditLog = boost::get < boost::tuples::length<T_result>::value - 2 > (r); - m_auditLogError = boost::get < boost::tuples::length<T_result>::value - 1 > (r); + m_auditLog = std::get < std::tuple_size<T_result>::value - 2 > (r); + m_auditLogError = std::get < std::tuple_size<T_result>::value - 1 > (r); resultHook(r); Q_EMIT this->done(); doEmitResult(r); @@ -244,31 +244,31 @@ protected: } private: template <typename T1, typename T2> - void doEmitResult(const boost::tuple<T1, T2> &tuple) + void doEmitResult(const std::tuple<T1, T2> &tuple) { - Q_EMIT this->result(boost::get<0>(tuple), boost::get<1>(tuple)); + Q_EMIT this->result(std::get<0>(tuple), std::get<1>(tuple)); } template <typename T1, typename T2, typename T3> - void doEmitResult(const boost::tuple<T1, T2, T3> &tuple) + void doEmitResult(const std::tuple<T1, T2, T3> &tuple) { - Q_EMIT this->result(boost::get<0>(tuple), boost::get<1>(tuple), boost::get<2>(tuple)); + Q_EMIT this->result(std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple)); } template <typename T1, typename T2, typename T3, typename T4> - void doEmitResult(const boost::tuple<T1, T2, T3, T4> &tuple) + void doEmitResult(const std::tuple<T1, T2, T3, T4> &tuple) { - Q_EMIT this->result(boost::get<0>(tuple), boost::get<1>(tuple), boost::get<2>(tuple), boost::get<3>(tuple)); + Q_EMIT this->result(std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple)); } template <typename T1, typename T2, typename T3, typename T4, typename T5> - void doEmitResult(const boost::tuple<T1, T2, T3, T4, T5> &tuple) + void doEmitResult(const std::tuple<T1, T2, T3, T4, T5> &tuple) { - Q_EMIT this->result(boost::get<0>(tuple), boost::get<1>(tuple), boost::get<2>(tuple), boost::get<3>(tuple), boost::get<4>(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: - boost::shared_ptr<GpgME::Context> m_ctx; + std::shared_ptr<GpgME::Context> m_ctx; Thread<T_result> m_thread; QString m_auditLog; GpgME::Error m_auditLogError; diff --git a/lang/qt/src/verifydetachedjob.h b/lang/qt/src/verifydetachedjob.h index ba574f6f..5d78874e 100644 --- a/lang/qt/src/verifydetachedjob.h +++ b/lang/qt/src/verifydetachedjob.h @@ -84,7 +84,7 @@ public: \throws GpgME::Exception if starting fails. */ - virtual void start(const boost::shared_ptr<QIODevice> &signature, const boost::shared_ptr<QIODevice> &signedData) = 0; + virtual void start(const std::shared_ptr<QIODevice> &signature, const std::shared_ptr<QIODevice> &signedData) = 0; virtual GpgME::VerificationResult exec(const QByteArray &signature, const QByteArray &signedData) = 0; diff --git a/lang/qt/src/verifyopaquejob.h b/lang/qt/src/verifyopaquejob.h index cdb1cf6e..89c592d9 100644 --- a/lang/qt/src/verifyopaquejob.h +++ b/lang/qt/src/verifyopaquejob.h @@ -87,7 +87,7 @@ public: \throws GpgME::Exception if starting fails */ - virtual void start(const boost::shared_ptr<QIODevice> &signedData, const boost::shared_ptr<QIODevice> &plainText = boost::shared_ptr<QIODevice>()) = 0; + virtual void start(const std::shared_ptr<QIODevice> &signedData, const std::shared_ptr<QIODevice> &plainText = std::shared_ptr<QIODevice>()) = 0; /** Synchronous version of @ref start */ virtual GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainText) = 0; |