From f98898ab1a6952e0c3a5d235963a27eba2e19e46 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Sun, 3 Apr 2016 04:52:16 -0800 Subject: [PATCH] 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. --- lang/cpp/src/assuanresult.h | 5 +- lang/cpp/src/configuration.cpp | 13 ++--- lang/cpp/src/configuration.h | 13 ++--- lang/cpp/src/data.h | 5 +- lang/cpp/src/decryptionresult.h | 7 ++- lang/cpp/src/defaultassuantransaction.cpp | 1 - lang/cpp/src/encryptionresult.cpp | 2 +- lang/cpp/src/encryptionresult.h | 8 +-- lang/cpp/src/engineinfo.h | 4 +- .../src/gpgagentgetinfoassuantransaction.cpp | 4 +- lang/cpp/src/gpgsignkeyeditinteractor.cpp | 10 ++-- lang/cpp/src/importresult.cpp | 2 +- lang/cpp/src/importresult.h | 8 +-- lang/cpp/src/key.h | 6 +-- lang/cpp/src/keygenerationresult.h | 4 +- lang/cpp/src/keylistresult.h | 4 +- lang/cpp/src/notation.h | 6 +-- lang/cpp/src/signingresult.cpp | 4 +- lang/cpp/src/signingresult.h | 12 ++--- lang/cpp/src/verificationresult.cpp | 8 +-- lang/cpp/src/verificationresult.h | 8 +-- lang/cpp/src/vfsmountresult.h | 4 +- lang/qt/src/dataprovider.cpp | 4 +- lang/qt/src/dataprovider.h | 6 +-- lang/qt/src/decryptjob.h | 2 +- lang/qt/src/decryptverifyjob.h | 2 +- lang/qt/src/downloadjob.h | 9 ++-- lang/qt/src/encryptjob.h | 4 +- lang/qt/src/qgpgmeadduseridjob.cpp | 2 +- lang/qt/src/qgpgmechangeexpiryjob.cpp | 2 +- lang/qt/src/qgpgmechangeownertrustjob.cpp | 2 +- lang/qt/src/qgpgmechangepasswdjob.cpp | 2 +- lang/qt/src/qgpgmedecryptjob.cpp | 25 +++++---- lang/qt/src/qgpgmedecryptjob.h | 4 +- lang/qt/src/qgpgmedecryptverifyjob.cpp | 25 +++++---- lang/qt/src/qgpgmedecryptverifyjob.h | 4 +- lang/qt/src/qgpgmedeletejob.cpp | 2 +- lang/qt/src/qgpgmedownloadjob.cpp | 13 ++--- lang/qt/src/qgpgmedownloadjob.h | 4 +- lang/qt/src/qgpgmeencryptjob.cpp | 18 +++---- lang/qt/src/qgpgmeencryptjob.h | 9 ++-- lang/qt/src/qgpgmeexportjob.cpp | 2 +- lang/qt/src/qgpgmeexportjob.h | 2 +- lang/qt/src/qgpgmeimportfromkeyserverjob.cpp | 2 +- lang/qt/src/qgpgmeimportfromkeyserverjob.h | 2 +- lang/qt/src/qgpgmeimportjob.cpp | 2 +- lang/qt/src/qgpgmeimportjob.h | 2 +- lang/qt/src/qgpgmekeygenerationjob.cpp | 2 +- lang/qt/src/qgpgmekeygenerationjob.h | 2 +- lang/qt/src/qgpgmekeylistjob.cpp | 8 +-- lang/qt/src/qgpgmekeylistjob.h | 5 +- lang/qt/src/qgpgmelistallkeysjob.cpp | 2 +- lang/qt/src/qgpgmelistallkeysjob.h | 2 +- lang/qt/src/qgpgmenewcryptoconfig.cpp | 16 +++--- lang/qt/src/qgpgmenewcryptoconfig.h | 16 +++--- lang/qt/src/qgpgmesignencryptjob.cpp | 18 +++---- lang/qt/src/qgpgmesignencryptjob.h | 6 +-- lang/qt/src/qgpgmesignjob.cpp | 20 +++---- lang/qt/src/qgpgmesignjob.h | 6 +-- lang/qt/src/qgpgmesignkeyjob.cpp | 4 +- lang/qt/src/qgpgmeverifydetachedjob.cpp | 12 ++--- lang/qt/src/qgpgmeverifydetachedjob.h | 4 +- lang/qt/src/qgpgmeverifyopaquejob.cpp | 16 +++--- lang/qt/src/qgpgmeverifyopaquejob.h | 4 +- lang/qt/src/signencryptjob.h | 4 +- lang/qt/src/signjob.h | 4 +- lang/qt/src/threadedjobmixin.h | 52 +++++++++---------- lang/qt/src/verifydetachedjob.h | 2 +- lang/qt/src/verifyopaquejob.h | 2 +- 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 -#include - #include #include +#include namespace GpgME { @@ -68,7 +67,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr d; + std::shared_ptr 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 #include #include +#include using namespace GpgME; using namespace GpgME::Configuration; -typedef boost::shared_ptr< boost::remove_pointer::type > shared_gpgme_conf_opt_t; -typedef boost::weak_ptr< boost::remove_pointer::type > weak_gpgme_conf_opt_t; +typedef std::shared_ptr< boost::remove_pointer::type > shared_gpgme_conf_opt_t; +typedef std::weak_ptr< boost::remove_pointer::type > weak_gpgme_conf_opt_t; -typedef boost::shared_ptr< boost::remove_pointer::type > shared_gpgme_conf_arg_t; -typedef boost::weak_ptr< boost::remove_pointer::type > weak_gpgme_conf_arg_t; +typedef std::shared_ptr< boost::remove_pointer::type > shared_gpgme_conf_arg_t; +typedef std::weak_ptr< boost::remove_pointer::type > weak_gpgme_conf_arg_t; -typedef boost::shared_ptr< boost::remove_pointer::type > shared_gpgme_ctx_t; -typedef boost::weak_ptr< boost::remove_pointer::type > weak_gpgme_ctx_t; +typedef std::shared_ptr< boost::remove_pointer::type > shared_gpgme_ctx_t; +typedef std::weak_ptr< boost::remove_pointer::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 -#include -#include -#if 0 -#include -#include -#endif - #include #include #include #include +#include namespace GpgME { namespace Configuration { -typedef boost::shared_ptr< boost::remove_pointer::type > shared_gpgme_conf_comp_t; -typedef boost::weak_ptr< boost::remove_pointer::type > weak_gpgme_conf_comp_t; +typedef std::shared_ptr< std::remove_pointer::type > shared_gpgme_conf_comp_t; +typedef std::weak_ptr< std::remove_pointer::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 - #include // for size_t, off_t #include // FILE #include +#include namespace GpgME { @@ -100,7 +99,7 @@ public: return d.get(); } private: - boost::shared_ptr d; + std::shared_ptr 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 - #include #include #include +#include namespace GpgME { @@ -84,7 +83,7 @@ public: private: class Private; void init(gpgme_ctx_t ctx); - boost::shared_ptr d; + std::shared_ptr d; }; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const DecryptionResult &result); @@ -119,7 +118,7 @@ public: private: class Private; - boost::shared_ptr d; + std::shared_ptr 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 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::EncryptionResult::invalidEncryptionK return result; } -GpgME::InvalidRecipient::InvalidRecipient(const boost::shared_ptr &parent, unsigned int i) +GpgME::InvalidRecipient::InvalidRecipient(const std::shared_ptr &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 +#include #include #include @@ -69,7 +69,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr d; + std::shared_ptr 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 &parent, unsigned int index); + InvalidRecipient(const std::shared_ptr &parent, unsigned int index); public: InvalidRecipient(); @@ -99,7 +99,7 @@ public: Error reason() const; private: - boost::shared_ptr d; + std::shared_ptr 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 +#include #include @@ -60,7 +60,7 @@ public: private: class Private; - boost::shared_ptr d; + std::shared_ptr 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 +#include #include 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 -#include -#include - #include #include #include @@ -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, SignKeyState> TransitionMap; +typedef std::map, 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(state()), status, std::string(args))); + const TransitionMap::const_iterator it = table.find(std::make_tuple(static_cast(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::ImportResult::imports() const return result; } -GpgME::Import::Import(const boost::shared_ptr &parent, unsigned int i) +GpgME::Import::Import(const std::shared_ptr &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 +#include #include @@ -83,13 +83,13 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr d; + std::shared_ptr d; }; class GPGMEPP_EXPORT Import { friend class ::GpgME::ImportResult; - Import(const boost::shared_ptr &parent, unsigned int idx); + Import(const std::shared_ptr &parent, unsigned int idx); public: Import(); @@ -122,7 +122,7 @@ public: Status status() const; private: - boost::shared_ptr d; + std::shared_ptr 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 -#include - +#include #include #include @@ -46,7 +44,7 @@ class Context; class Subkey; class UserID; -typedef boost::shared_ptr< boost::remove_pointer::type > shared_gpgme_key_t; +typedef std::shared_ptr< std::remove_pointer::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 +#include namespace GpgME { @@ -72,7 +72,7 @@ public: private: class Private; void init(gpgme_ctx_t ctx); - boost::shared_ptr d; + std::shared_ptr 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 +#include namespace GpgME { @@ -71,7 +71,7 @@ private: void detach(); void init(gpgme_ctx_t ctx); class Private; - boost::shared_ptr d; + std::shared_ptr 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 +#include #include @@ -37,7 +37,7 @@ namespace GpgME class GPGMEPP_EXPORT Notation { friend class ::GpgME::Signature; - Notation(const boost::shared_ptr &parent, unsigned int sindex, unsigned int nindex); + Notation(const std::shared_ptr &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 d; + std::shared_ptr 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::SigningResult::invalidSigningKeys() return result; } -GpgME::InvalidSigningKey::InvalidSigningKey(const boost::shared_ptr &parent, unsigned int i) +GpgME::InvalidSigningKey::InvalidSigningKey(const std::shared_ptr &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 &parent, unsigned int i) +GpgME::CreatedSignature::CreatedSignature(const std::shared_ptr &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 -#include +#include #include #include @@ -72,7 +72,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr d; + std::shared_ptr 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 &parent, unsigned int index); + InvalidSigningKey(const std::shared_ptr &parent, unsigned int index); public: InvalidSigningKey(); @@ -103,7 +103,7 @@ public: Error reason() const; private: - boost::shared_ptr d; + std::shared_ptr 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 &parent, unsigned int index); + CreatedSignature(const std::shared_ptr &parent, unsigned int index); public: CreatedSignature(); @@ -147,7 +147,7 @@ public: unsigned int signatureClass() const; private: - boost::shared_ptr d; + std::shared_ptr 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::VerificationResult::signatures() const return result; } -GpgME::Signature::Signature(const boost::shared_ptr &parent, unsigned int i) +GpgME::Signature::Signature(const std::shared_ptr &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 &priv, unsigned int sindex, unsigned int nindex) + Private(const std::shared_ptr &priv, unsigned int sindex, unsigned int nindex) : d(priv), sidx(sindex), nidx(nindex), nota(0) { @@ -399,12 +399,12 @@ public: } } - boost::shared_ptr d; + std::shared_ptr d; unsigned int sidx, nidx; gpgme_sig_notation_t nota; }; -GpgME::Notation::Notation(const boost::shared_ptr &parent, unsigned int sindex, unsigned int nindex) +GpgME::Notation::Notation(const std::shared_ptr &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 -#include +#include #include #include @@ -73,7 +73,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr d; + std::shared_ptr 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 &parent, unsigned int index); + Signature(const std::shared_ptr &parent, unsigned int index); public: typedef GPGMEPP_DEPRECATED GpgME::Notation Notation; @@ -157,7 +157,7 @@ public: std::vector notations() const; private: - boost::shared_ptr d; + std::shared_ptr 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 +#include #include #include @@ -64,7 +64,7 @@ public: class Private; private: void init(gpgme_ctx_t ctx); - boost::shared_ptr d; + std::shared_ptr 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 &io) +QIODeviceDataProvider::QIODeviceDataProvider(const std::shared_ptr &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 &io, char *buffer, qint64 maxSize) +static qint64 blocking_read(const std::shared_ptr &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 &initialData); + explicit QIODeviceDataProvider(const std::shared_ptr &initialData); ~QIODeviceDataProvider(); - const boost::shared_ptr &ioDevice() const + const std::shared_ptr &ioDevice() const { return mIO; } @@ -95,7 +95,7 @@ private: void release(); private: - const boost::shared_ptr mIO; + const std::shared_ptr 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 &cipherText, const boost::shared_ptr &plainText = boost::shared_ptr()) = 0; + virtual void start(const std::shared_ptr &cipherText, const std::shared_ptr &plainText = std::shared_ptr()) = 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 &cipherText, const boost::shared_ptr &plainText = boost::shared_ptr()) = 0; + virtual void start(const std::shared_ptr &cipherText, const std::shared_ptr &plainText = std::shared_ptr()) = 0; /** Synchronous equivalent of start() */ virtual std::pair 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 +#include + namespace GpgME { class Error; } -namespace boost -{ -template 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 &keyData) = 0; + const std::shared_ptr &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 &recipients, - const boost::shared_ptr &plainText, - const boost::shared_ptr &cipherText = boost::shared_ptr(), + const std::shared_ptr &plainText, + const std::shared_ptr &cipherText = std::shared_ptr(), bool alwaysTrust = false) = 0; virtual GpgME::EncryptionResult exec(const std::vector &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 -#include - #include 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 &cipherText_, const weak_ptr &plainText_) +static QGpgMEDecryptJob::result_type decrypt(Context *ctx, QThread *thread, + const std::weak_ptr &cipherText_, + const std::weak_ptr &plainText_) { - const shared_ptr cipherText = cipherText_.lock(); - const shared_ptr plainText = plainText_.lock(); + const std::shared_ptr cipherText = cipherText_.lock(); + const std::shared_ptr 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 buffer(new QBuffer); + const std::shared_ptr 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()); + return decrypt(ctx, 0, buffer, std::shared_ptr()); } Error QGpgMEDecryptJob::start(const QByteArray &cipherText) @@ -105,7 +104,7 @@ Error QGpgMEDecryptJob::start(const QByteArray &cipherText) return Error(); } -void QGpgMEDecryptJob::start(const shared_ptr &cipherText, const shared_ptr &plainText) +void QGpgMEDecryptJob::start(const std::shared_ptr &cipherText, const std::shared_ptr &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 > + : public _detail::ThreadedJobMixin > #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 &cipherText, const boost::shared_ptr &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr &cipherText, const std::shared_ptr &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 -#include - #include 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 &cipherText_, const weak_ptr &plainText_) +static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread *thread, + const std::weak_ptr &cipherText_, + const std::weak_ptr &plainText_) { qCDebug(GPGPME_BACKEND_LOG); - const shared_ptr cipherText = cipherText_.lock(); - const shared_ptr plainText = plainText_.lock(); + const std::shared_ptr cipherText = cipherText_.lock(); + const std::shared_ptr 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 buffer(new QBuffer); + const std::shared_ptr 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()); + return decrypt_verify(ctx, 0, buffer, std::shared_ptr()); } Error QGpgMEDecryptVerifyJob::start(const QByteArray &cipherText) @@ -113,7 +112,7 @@ Error QGpgMEDecryptVerifyJob::start(const QByteArray &cipherText) return Error(); } -void QGpgMEDecryptVerifyJob::start(const shared_ptr &cipherText, const shared_ptr &plainText) +void QGpgMEDecryptVerifyJob::start(const std::shared_ptr &cipherText, const std::shared_ptr &plainText) { run(bind(&decrypt_verify, _1, _2, _3, _4), cipherText, plainText); } @@ -122,7 +121,7 @@ std::pair 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 > + : public _detail::ThreadedJobMixin > #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 &cipherText, const boost::shared_ptr &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr &cipherText, const std::shared_ptr &plainText) Q_DECL_OVERRIDE; /*! \reimp from DecryptVerifyJob */ std::pair 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 -#include - #include 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 &keyData_) +static QGpgMEDownloadJob::result_type download(Context *ctx, QThread *thread, const QByteArray &fpr, const std::weak_ptr &keyData_) { - const shared_ptr keyData = keyData_.lock(); + const std::shared_ptr 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 &keyData) +Error QGpgMEDownloadJob::start(const QByteArray &fpr, const std::shared_ptr &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 > + : public _detail::ThreadedJobMixin > #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 &keyData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &fingerprint, const std::shared_ptr &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 &recipients, - const weak_ptr &plainText_, - const weak_ptr &cipherText_, + const std::weak_ptr &plainText_, + const std::weak_ptr &cipherText_, bool alwaysTrust, bool outputIsBsse64Encoded) { - const shared_ptr plainText = plainText_.lock(); - const shared_ptr cipherText = cipherText_.lock(); + const std::shared_ptr plainText = plainText_.lock(); + const std::shared_ptr 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 &recipients, const QByteArray &plainText, bool alwaysTrust, bool outputIsBsse64Encoded) { - const shared_ptr buffer(new QBuffer); + const std::shared_ptr 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(), alwaysTrust, outputIsBsse64Encoded); + return encrypt(ctx, 0, recipients, buffer, std::shared_ptr(), alwaysTrust, outputIsBsse64Encoded); } Error QGpgMEEncryptJob::start(const std::vector &recipients, const QByteArray &plainText, bool alwaysTrust) @@ -127,7 +127,7 @@ Error QGpgMEEncryptJob::start(const std::vector &recipients, const QByteArr return Error(); } -void QGpgMEEncryptJob::start(const std::vector &recipients, const shared_ptr &plainText, const shared_ptr &cipherText, bool alwaysTrust) +void QGpgMEEncryptJob::start(const std::vector &recipients, const std::shared_ptr &plainText, const std::shared_ptr &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 > + : public _detail::ThreadedJobMixin > #endif { Q_OBJECT @@ -74,8 +74,8 @@ public: /*! \reimp from EncryptJob */ void start(const std::vector &recipients, - const boost::shared_ptr &plainText, - const boost::shared_ptr &cipherText, + const std::shared_ptr &plainText, + const std::shared_ptr &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 > + : public _detail::ThreadedJobMixin > #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 &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 > + : public _detail::ThreadedJobMixin > #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 > + : public _detail::ThreadedJobMixin > #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 > + : public _detail::ThreadedJobMixin > #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 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(), QString(), Error()); + return std::make_tuple(KeyListResult(), std::vector(), 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, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin, QString, GpgME::Error> > #endif { Q_OBJECT @@ -74,9 +74,6 @@ public: /*! \reimp from KeyListJob */ GpgME::KeyListResult exec(const QStringList &patterns, bool secretOnly, std::vector &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, std::vector, QString, GpgME::Error> > + : public _detail::ThreadedJobMixin, std::vector, 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 comp(new QGpgMENewCryptoConfigComponent); + const std::shared_ptr 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 &c, m_componentsByName) + BOOST_FOREACH(const std::shared_ptr &c, m_componentsByName) c->sync(runtime); } @@ -164,7 +164,7 @@ void QGpgMENewCryptoConfigComponent::setComponent(const Component &component) m_component = component; m_groupsByName.clear(); - shared_ptr group; + std::shared_ptr group; const std::vector