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.
This commit is contained in:
Andre Heinecke 2016-04-03 04:52:16 -08:00
parent c07aaef6eb
commit f98898ab1a
69 changed files with 232 additions and 264 deletions

View File

@ -30,10 +30,9 @@
#include <time.h> #include <time.h>
#include <boost/shared_ptr.hpp>
#include <vector> #include <vector>
#include <iosfwd> #include <iosfwd>
#include <memory>
namespace GpgME namespace GpgME
{ {
@ -68,7 +67,7 @@ public:
class Private; class Private;
private: private:
void init(gpgme_ctx_t ctx); 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); GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const AssuanResult &result);

View File

@ -32,18 +32,19 @@
#include <algorithm> #include <algorithm>
#include <ostream> #include <ostream>
#include <cstring> #include <cstring>
#include <assert.h>
using namespace GpgME; using namespace GpgME;
using namespace GpgME::Configuration; using namespace GpgME::Configuration;
typedef boost::shared_ptr< boost::remove_pointer<gpgme_conf_opt_t>::type > shared_gpgme_conf_opt_t; typedef std::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::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 std::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::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 std::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::weak_ptr< boost::remove_pointer<gpgme_ctx_t>::type > weak_gpgme_ctx_t;
namespace namespace
{ {

View File

@ -28,26 +28,19 @@
#include "gpgmefw.h" #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 <iosfwd>
#include <vector> #include <vector>
#include <string> #include <string>
#include <algorithm> #include <algorithm>
#include <memory>
namespace GpgME namespace GpgME
{ {
namespace Configuration namespace Configuration
{ {
typedef boost::shared_ptr< boost::remove_pointer<gpgme_conf_comp_t>::type > shared_gpgme_conf_comp_t; typedef std::shared_ptr< std::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::weak_ptr< std::remove_pointer<gpgme_conf_comp_t>::type > weak_gpgme_conf_comp_t;
class Argument; class Argument;
class Option; class Option;

View File

@ -25,11 +25,10 @@
#include "global.h" #include "global.h"
#include <boost/shared_ptr.hpp>
#include <sys/types.h> // for size_t, off_t #include <sys/types.h> // for size_t, off_t
#include <cstdio> // FILE #include <cstdio> // FILE
#include <algorithm> #include <algorithm>
#include <memory>
namespace GpgME namespace GpgME
{ {
@ -100,7 +99,7 @@ public:
return d.get(); return d.get();
} }
private: private:
boost::shared_ptr<Private> d; std::shared_ptr<Private> d;
}; };
} }

View File

@ -27,11 +27,10 @@
#include "result.h" #include "result.h"
#include "gpgmepp_export.h" #include "gpgmepp_export.h"
#include <boost/shared_ptr.hpp>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <iosfwd> #include <iosfwd>
#include <memory>
namespace GpgME namespace GpgME
{ {
@ -84,7 +83,7 @@ public:
private: private:
class Private; class Private;
void init(gpgme_ctx_t ctx); 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); GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const DecryptionResult &result);
@ -119,7 +118,7 @@ public:
private: private:
class 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); GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const DecryptionResult::Recipient &reci);

View File

@ -27,7 +27,6 @@
#include <sstream> #include <sstream>
using namespace GpgME; using namespace GpgME;
using namespace boost;
DefaultAssuanTransaction::DefaultAssuanTransaction() DefaultAssuanTransaction::DefaultAssuanTransaction()
: AssuanTransaction(), : AssuanTransaction(),

View File

@ -111,7 +111,7 @@ std::vector<GpgME::InvalidRecipient> GpgME::EncryptionResult::invalidEncryptionK
return result; 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) : d(parent), idx(i)
{ {

View File

@ -27,7 +27,7 @@
#include "result.h" #include "result.h"
#include "gpgmepp_export.h" #include "gpgmepp_export.h"
#include <boost/shared_ptr.hpp> #include <memory>
#include <vector> #include <vector>
#include <iosfwd> #include <iosfwd>
@ -69,7 +69,7 @@ public:
class Private; class Private;
private: private:
void init(gpgme_ctx_t ctx); 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); 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 class GPGMEPP_EXPORT InvalidRecipient
{ {
friend class ::GpgME::EncryptionResult; 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: public:
InvalidRecipient(); InvalidRecipient();
@ -99,7 +99,7 @@ public:
Error reason() const; Error reason() const;
private: private:
boost::shared_ptr<EncryptionResult::Private> d; std::shared_ptr<EncryptionResult::Private> d;
unsigned int idx; unsigned int idx;
}; };

View File

@ -25,7 +25,7 @@
#include "global.h" #include "global.h"
#include <boost/shared_ptr.hpp> #include <memory>
#include <algorithm> #include <algorithm>
@ -60,7 +60,7 @@ public:
private: private:
class Private; class Private;
boost::shared_ptr<Private> d; std::shared_ptr<Private> d;
}; };
} }

View File

@ -25,12 +25,11 @@
#include "data.h" #include "data.h"
#include "util.h" #include "util.h"
#include <boost/static_assert.hpp> #include <assert.h>
#include <sstream> #include <sstream>
using namespace GpgME; using namespace GpgME;
using namespace boost;
GpgAgentGetInfoAssuanTransaction::GpgAgentGetInfoAssuanTransaction(InfoItem item) GpgAgentGetInfoAssuanTransaction::GpgAgentGetInfoAssuanTransaction(InfoItem item)
: AssuanTransaction(), : AssuanTransaction(),
@ -86,7 +85,6 @@ static const char *const gpgagent_getinfo_tokens[] = {
"ssh_socket_name", "ssh_socket_name",
"scd_running", "scd_running",
}; };
BOOST_STATIC_ASSERT((sizeof gpgagent_getinfo_tokens / sizeof * gpgagent_getinfo_tokens == GpgAgentGetInfoAssuanTransaction::LastInfoItem));
void GpgAgentGetInfoAssuanTransaction::makeCommand() const void GpgAgentGetInfoAssuanTransaction::makeCommand() const
{ {

View File

@ -26,9 +26,6 @@
#include <gpgme.h> #include <gpgme.h>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <map> #include <map>
#include <string> #include <string>
#include <sstream> #include <sstream>
@ -48,7 +45,6 @@ using std::strcmp;
#define snprintf _snprintf #define snprintf _snprintf
#endif #endif
using namespace boost;
using namespace GpgME; using namespace GpgME;
class GpgSignKeyEditInteractor::Private class GpgSignKeyEditInteractor::Private
@ -161,7 +157,7 @@ enum SignKeyState {
ERROR = EditInteractor::ErrorState 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; TransitionMap tab;
const unsigned int GET_BOOL = GPGME_STATUS_GET_BOOL; const unsigned int GET_BOOL = GPGME_STATUS_GET_BOOL;
const unsigned int GET_LINE = GPGME_STATUS_GET_LINE; 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(START, GET_LINE, "keyedit.prompt", COMMAND);
addEntry(COMMAND, GET_BOOL, "keyedit.sign_all.okay", UIDS_ANSWER_SIGN_ALL); addEntry(COMMAND, GET_BOOL, "keyedit.sign_all.okay", UIDS_ANSWER_SIGN_ALL);
addEntry(COMMAND, GET_BOOL, "sign_uid.okay", CONFIRM); 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; using namespace GpgSignKeyEditInteractor_Private;
//lookup transition in map //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()) { if (it != table.end()) {
return it->second; return it->second;
} }

View File

@ -166,7 +166,7 @@ std::vector<GpgME::Import> GpgME::ImportResult::imports() const
return result; 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) : d(parent), idx(i)
{ {

View File

@ -27,7 +27,7 @@
#include "result.h" #include "result.h"
#include "gpgmepp_export.h" #include "gpgmepp_export.h"
#include <boost/shared_ptr.hpp> #include <memory>
#include <vector> #include <vector>
@ -83,13 +83,13 @@ public:
class Private; class Private;
private: private:
void init(gpgme_ctx_t ctx); void init(gpgme_ctx_t ctx);
boost::shared_ptr<Private> d; std::shared_ptr<Private> d;
}; };
class GPGMEPP_EXPORT Import class GPGMEPP_EXPORT Import
{ {
friend class ::GpgME::ImportResult; 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: public:
Import(); Import();
@ -122,7 +122,7 @@ public:
Status status() const; Status status() const;
private: private:
boost::shared_ptr<ImportResult::Private> d; std::shared_ptr<ImportResult::Private> d;
unsigned int idx; unsigned int idx;
}; };

View File

@ -29,9 +29,7 @@
#include "gpgmefw.h" #include "gpgmefw.h"
#include <boost/shared_ptr.hpp> #include <memory>
#include <boost/type_traits/remove_pointer.hpp>
#include <sys/time.h> #include <sys/time.h>
#include <vector> #include <vector>
@ -46,7 +44,7 @@ class Context;
class Subkey; class Subkey;
class UserID; 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 // class Key

View File

@ -27,7 +27,7 @@
#include "result.h" #include "result.h"
#include "gpgmepp_export.h" #include "gpgmepp_export.h"
#include <boost/shared_ptr.hpp> #include <memory>
namespace GpgME namespace GpgME
{ {
@ -72,7 +72,7 @@ public:
private: private:
class Private; class Private;
void init(gpgme_ctx_t ctx); void init(gpgme_ctx_t ctx);
boost::shared_ptr<Private> d; std::shared_ptr<Private> d;
}; };
} }

View File

@ -27,7 +27,7 @@
#include "result.h" #include "result.h"
#include "gpgmepp_export.h" #include "gpgmepp_export.h"
#include <boost/shared_ptr.hpp> #include <memory>
namespace GpgME namespace GpgME
{ {
@ -71,7 +71,7 @@ private:
void detach(); void detach();
void init(gpgme_ctx_t ctx); void init(gpgme_ctx_t ctx);
class Private; class Private;
boost::shared_ptr<Private> d; std::shared_ptr<Private> d;
}; };
} }

View File

@ -27,7 +27,7 @@
#include "verificationresult.h" #include "verificationresult.h"
#include "gpgmepp_export.h" #include "gpgmepp_export.h"
#include <boost/shared_ptr.hpp> #include <memory>
#include <iosfwd> #include <iosfwd>
@ -37,7 +37,7 @@ namespace GpgME
class GPGMEPP_EXPORT Notation class GPGMEPP_EXPORT Notation
{ {
friend class ::GpgME::Signature; 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: public:
Notation(); Notation();
explicit Notation(gpgme_sig_notation_t nota); explicit Notation(gpgme_sig_notation_t nota);
@ -71,7 +71,7 @@ public:
private: private:
class Private; class Private;
boost::shared_ptr<Private> d; std::shared_ptr<Private> d;
}; };
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Notation &nota); GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Notation &nota);

View File

@ -137,7 +137,7 @@ std::vector<GpgME::InvalidSigningKey> GpgME::SigningResult::invalidSigningKeys()
return result; 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) : d(parent), idx(i)
{ {
@ -160,7 +160,7 @@ GpgME::Error GpgME::InvalidSigningKey::reason() const
return Error(isNull() ? 0 : d->invalid[idx]->reason); 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) : d(parent), idx(i)
{ {

View File

@ -28,7 +28,7 @@
#include <time.h> #include <time.h>
#include <boost/shared_ptr.hpp> #include <memory>
#include <vector> #include <vector>
#include <iosfwd> #include <iosfwd>
@ -72,7 +72,7 @@ public:
class Private; class Private;
private: private:
void init(gpgme_ctx_t ctx); 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); 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 class GPGMEPP_EXPORT InvalidSigningKey
{ {
friend class ::GpgME::SigningResult; 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: public:
InvalidSigningKey(); InvalidSigningKey();
@ -103,7 +103,7 @@ public:
Error reason() const; Error reason() const;
private: private:
boost::shared_ptr<SigningResult::Private> d; std::shared_ptr<SigningResult::Private> d;
unsigned int idx; unsigned int idx;
}; };
@ -112,7 +112,7 @@ GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const InvalidSigningKe
class GPGMEPP_EXPORT CreatedSignature class GPGMEPP_EXPORT CreatedSignature
{ {
friend class ::GpgME::SigningResult; 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: public:
CreatedSignature(); CreatedSignature();
@ -147,7 +147,7 @@ public:
unsigned int signatureClass() const; unsigned int signatureClass() const;
private: private:
boost::shared_ptr<SigningResult::Private> d; std::shared_ptr<SigningResult::Private> d;
unsigned int idx; unsigned int idx;
}; };

View File

@ -165,7 +165,7 @@ std::vector<GpgME::Signature> GpgME::VerificationResult::signatures() const
return result; 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) : d(parent), idx(i)
{ {
} }
@ -367,7 +367,7 @@ class GpgME::Notation::Private
{ {
public: public:
Private() : d(), sidx(0), nidx(0), nota(0) {} 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) : 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; unsigned int sidx, nidx;
gpgme_sig_notation_t nota; 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)) : d(new Private(parent, sindex, nindex))
{ {

View File

@ -29,7 +29,7 @@
#include <time.h> #include <time.h>
#include <boost/shared_ptr.hpp> #include <memory>
#include <vector> #include <vector>
#include <iosfwd> #include <iosfwd>
@ -73,7 +73,7 @@ public:
class Private; class Private;
private: private:
void init(gpgme_ctx_t ctx); 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); 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 class GPGMEPP_EXPORT Signature
{ {
friend class ::GpgME::VerificationResult; 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: public:
typedef GPGMEPP_DEPRECATED GpgME::Notation Notation; typedef GPGMEPP_DEPRECATED GpgME::Notation Notation;
@ -157,7 +157,7 @@ public:
std::vector<GpgME::Notation> notations() const; std::vector<GpgME::Notation> notations() const;
private: private:
boost::shared_ptr<VerificationResult::Private> d; std::shared_ptr<VerificationResult::Private> d;
unsigned int idx; unsigned int idx;
}; };

View File

@ -28,7 +28,7 @@
#include "result.h" #include "result.h"
#include "gpgmepp_export.h" #include "gpgmepp_export.h"
#include <boost/shared_ptr.hpp> #include <memory>
#include <vector> #include <vector>
#include <iosfwd> #include <iosfwd>
@ -64,7 +64,7 @@ public:
class Private; class Private;
private: private:
void init(gpgme_ctx_t ctx); 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); GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const VfsMountResult &result);

View File

@ -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(), : GpgME::DataProvider(),
mIO(io), mIO(io),
mErrorOccurred(false), 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()) { while (!io->bytesAvailable()) {
if (!io->waitForReadyRead(-1)) { if (!io->waitForReadyRead(-1)) {

View File

@ -72,10 +72,10 @@ private:
class QGPGME_EXPORT QIODeviceDataProvider : public GpgME::DataProvider class QGPGME_EXPORT QIODeviceDataProvider : public GpgME::DataProvider
{ {
public: public:
explicit QIODeviceDataProvider(const boost::shared_ptr<QIODevice> &initialData); explicit QIODeviceDataProvider(const std::shared_ptr<QIODevice> &initialData);
~QIODeviceDataProvider(); ~QIODeviceDataProvider();
const boost::shared_ptr<QIODevice> &ioDevice() const const std::shared_ptr<QIODevice> &ioDevice() const
{ {
return mIO; return mIO;
} }
@ -95,7 +95,7 @@ private:
void release(); void release();
private: private:
const boost::shared_ptr<QIODevice> mIO; const std::shared_ptr<QIODevice> mIO;
bool mErrorOccurred : 1; bool mErrorOccurred : 1;
bool mHaveQProcess : 1; bool mHaveQProcess : 1;
}; };

View File

@ -86,7 +86,7 @@ public:
\throws GpgME::Exception if starting fails \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, virtual GpgME::DecryptionResult exec(const QByteArray &cipherText,
QByteArray &plainText) = 0; QByteArray &plainText) = 0;

View File

@ -87,7 +87,7 @@ public:
\throws GpgME::Exception if starting fails \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() */ /** Synchronous equivalent of start() */
virtual std::pair<GpgME::DecryptionResult, GpgME::VerificationResult> virtual std::pair<GpgME::DecryptionResult, GpgME::VerificationResult>

View File

@ -38,16 +38,13 @@
#include <QtCore/QByteArray> #include <QtCore/QByteArray>
#include <memory>
namespace GpgME namespace GpgME
{ {
class Error; class Error;
} }
namespace boost
{
template <typename T> class shared_ptr;
}
class QStringList; class QStringList;
class QIODevice; class QIODevice;
class QByteArray; class QByteArray;
@ -86,7 +83,7 @@ public:
passed as the second argument of result(). passed as the second argument of result().
*/ */
virtual GpgME::Error start(const QByteArray &fingerprint, 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 Starts the download operation. \a fingerprints is a list of

View File

@ -97,8 +97,8 @@ public:
\throws GpgME::Exception if starting fails \throws GpgME::Exception if starting fails
*/ */
virtual void start(const std::vector<GpgME::Key> &recipients, virtual void start(const std::vector<GpgME::Key> &recipients,
const boost::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &plainText,
const boost::shared_ptr<QIODevice> &cipherText = boost::shared_ptr<QIODevice>(), const std::shared_ptr<QIODevice> &cipherText = std::shared_ptr<QIODevice>(),
bool alwaysTrust = false) = 0; bool alwaysTrust = false) = 0;
virtual GpgME::EncryptionResult exec(const std::vector<GpgME::Key> &recipients, virtual GpgME::EncryptionResult exec(const std::vector<GpgME::Key> &recipients,

View File

@ -72,7 +72,7 @@ static QGpgMEAddUserIDJob::result_type add_user_id(Context *ctx, const Key &key,
const Error err = ctx->edit(key, ei, data); const Error err = ctx->edit(key, ei, data);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMEAddUserIDJob::start(const Key &key, const QString &name, const QString &email, const QString &comment)

View File

@ -71,7 +71,7 @@ static QGpgMEChangeExpiryJob::result_type change_expiry(Context *ctx, const Key
const Error err = ctx->edit(key, ei, data); const Error err = ctx->edit(key, ei, data);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMEChangeExpiryJob::start(const Key &key, const QDateTime &expiry)

View File

@ -67,7 +67,7 @@ static QGpgMEChangeOwnerTrustJob::result_type change_ownertrust(Context *ctx, co
const Error err = ctx->edit(key, ei, data); const Error err = ctx->edit(key, ei, data);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMEChangeOwnerTrustJob::start(const Key &key, Key::OwnerTrust trust)

View File

@ -68,7 +68,7 @@ static QGpgMEChangePasswdJob::result_type change_passwd(Context *ctx, const Key
#endif #endif
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMEChangePasswdJob::start(const Key &key)

View File

@ -41,13 +41,10 @@
#include <QBuffer> #include <QBuffer>
#include <boost/weak_ptr.hpp>
#include <cassert> #include <cassert>
using namespace QGpgME; using namespace QGpgME;
using namespace GpgME; using namespace GpgME;
using namespace boost;
QGpgMEDecryptJob::QGpgMEDecryptJob(Context *context) QGpgMEDecryptJob::QGpgMEDecryptJob(Context *context)
: mixin_type(context) : mixin_type(context)
@ -57,11 +54,13 @@ QGpgMEDecryptJob::QGpgMEDecryptJob(Context *context)
QGpgMEDecryptJob::~QGpgMEDecryptJob() {} 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 std::shared_ptr<QIODevice> cipherText = cipherText_.lock();
const shared_ptr<QIODevice> plainText = plainText_.lock(); const std::shared_ptr<QIODevice> plainText = plainText_.lock();
const _detail::ToThreadMover ctMover(cipherText, thread); const _detail::ToThreadMover ctMover(cipherText, thread);
const _detail::ToThreadMover ptMover(plainText, 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); const DecryptionResult res = ctx->decrypt(indata, outdata);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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 { } else {
QGpgME::QIODeviceDataProvider out(plainText); QGpgME::QIODeviceDataProvider out(plainText);
Data outdata(&out); Data outdata(&out);
@ -84,19 +83,19 @@ static QGpgMEDecryptJob::result_type decrypt(Context *ctx, QThread *thread, cons
const DecryptionResult res = ctx->decrypt(indata, outdata); const DecryptionResult res = ctx->decrypt(indata, outdata);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) 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); buffer->setData(cipherText);
if (!buffer->open(QIODevice::ReadOnly)) { if (!buffer->open(QIODevice::ReadOnly)) {
assert(!"This should never happen: QBuffer::open() failed"); 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) Error QGpgMEDecryptJob::start(const QByteArray &cipherText)
@ -105,7 +104,7 @@ Error QGpgMEDecryptJob::start(const QByteArray &cipherText)
return Error(); 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); run(bind(&decrypt, _1, _2, _3, _4), cipherText, plainText);
} }
@ -114,7 +113,7 @@ GpgME::DecryptionResult QGpgME::QGpgMEDecryptJob::exec(const QByteArray &cipherT
QByteArray &plainText) QByteArray &plainText)
{ {
const result_type r = decrypt_qba(context(), cipherText); const result_type r = decrypt_qba(context(), cipherText);
plainText = get<1>(r); plainText = std::get<1>(r);
resultHook(r); resultHook(r);
return mResult; return mResult;
} }
@ -123,7 +122,7 @@ GpgME::DecryptionResult QGpgME::QGpgMEDecryptJob::exec(const QByteArray &cipherT
void QGpgMEDecryptJob::resultHook(const result_type &tuple) void QGpgMEDecryptJob::resultHook(const result_type &tuple)
{ {
mResult = get<0>(tuple); mResult = std::get<0>(tuple);
} }
#include "qgpgmedecryptjob.moc" #include "qgpgmedecryptjob.moc"

View File

@ -51,7 +51,7 @@ class QGpgMEDecryptJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public DecryptJob : public DecryptJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT
@ -67,7 +67,7 @@ public:
GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE; GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE;
/*! \reimp from DecryptJob */ /*! \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 */ /*! \reimp from DecryptJob */
GpgME::DecryptionResult exec(const QByteArray &cipherText, GpgME::DecryptionResult exec(const QByteArray &cipherText,

View File

@ -45,13 +45,10 @@
#include <QBuffer> #include <QBuffer>
#include <boost/weak_ptr.hpp>
#include <cassert> #include <cassert>
using namespace QGpgME; using namespace QGpgME;
using namespace GpgME; using namespace GpgME;
using namespace boost;
QGpgMEDecryptVerifyJob::QGpgMEDecryptVerifyJob(Context *context) QGpgMEDecryptVerifyJob::QGpgMEDecryptVerifyJob(Context *context)
: mixin_type(context) : mixin_type(context)
@ -61,13 +58,15 @@ QGpgMEDecryptVerifyJob::QGpgMEDecryptVerifyJob(Context *context)
QGpgMEDecryptVerifyJob::~QGpgMEDecryptVerifyJob() {} 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); qCDebug(GPGPME_BACKEND_LOG);
const shared_ptr<QIODevice> cipherText = cipherText_.lock(); const std::shared_ptr<QIODevice> cipherText = cipherText_.lock();
const shared_ptr<QIODevice> plainText = plainText_.lock(); const std::shared_ptr<QIODevice> plainText = plainText_.lock();
const _detail::ToThreadMover ctMover(cipherText, thread); const _detail::ToThreadMover ctMover(cipherText, thread);
const _detail::ToThreadMover ptMover(plainText, thread); const _detail::ToThreadMover ptMover(plainText, thread);
@ -83,7 +82,7 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, ae); const QString log = _detail::audit_log_as_html(ctx, ae);
qCDebug(GPGPME_BACKEND_LOG) << "End no plainText. Error: " << 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 { } else {
QGpgME::QIODeviceDataProvider out(plainText); QGpgME::QIODeviceDataProvider out(plainText);
Data outdata(&out); Data outdata(&out);
@ -92,19 +91,19 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify(Context *ctx, QThread
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, ae); const QString log = _detail::audit_log_as_html(ctx, ae);
qCDebug(GPGPME_BACKEND_LOG) << "End plainText. Error: " << 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) 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); buffer->setData(cipherText);
if (!buffer->open(QIODevice::ReadOnly)) { if (!buffer->open(QIODevice::ReadOnly)) {
assert(!"This should never happen: QBuffer::open() failed"); 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) Error QGpgMEDecryptVerifyJob::start(const QByteArray &cipherText)
@ -113,7 +112,7 @@ Error QGpgMEDecryptVerifyJob::start(const QByteArray &cipherText)
return Error(); 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); 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) QGpgME::QGpgMEDecryptVerifyJob::exec(const QByteArray &cipherText, QByteArray &plainText)
{ {
const result_type r = decrypt_verify_qba(context(), cipherText); const result_type r = decrypt_verify_qba(context(), cipherText);
plainText = get<2>(r); plainText = std::get<2>(r);
resultHook(r); resultHook(r);
return mResult; return mResult;
} }
@ -131,6 +130,6 @@ QGpgME::QGpgMEDecryptVerifyJob::exec(const QByteArray &cipherText, QByteArray &p
void QGpgMEDecryptVerifyJob::resultHook(const result_type &tuple) 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" #include "qgpgmedecryptverifyjob.moc"

View File

@ -56,7 +56,7 @@ class QGpgMEDecryptVerifyJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public DecryptVerifyJob : public DecryptVerifyJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT
@ -72,7 +72,7 @@ public:
GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE; GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE;
/*! \reimp from DecryptVerifyJob */ /*! \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 */ /*! \reimp from DecryptVerifyJob */
std::pair<GpgME::DecryptionResult, GpgME::VerificationResult> std::pair<GpgME::DecryptionResult, GpgME::VerificationResult>

View File

@ -55,7 +55,7 @@ static QGpgMEDeleteJob::result_type delete_key(Context *ctx, const Key &key, boo
const Error err = ctx->deleteKey(key, allowSecretKeyDeletion); const Error err = ctx->deleteKey(key, allowSecretKeyDeletion);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMEDeleteJob::start(const Key &key, bool allowSecretKeyDeletion)

View File

@ -40,13 +40,10 @@
#include <QStringList> #include <QStringList>
#include <boost/weak_ptr.hpp>
#include <cassert> #include <cassert>
using namespace QGpgME; using namespace QGpgME;
using namespace GpgME; using namespace GpgME;
using namespace boost;
QGpgMEDownloadJob::QGpgMEDownloadJob(Context *context) QGpgMEDownloadJob::QGpgMEDownloadJob(Context *context)
: mixin_type(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); const Error err = ctx->exportPublicKeys(pc.patterns(), data);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) { if (!keyData) {
return download_qsl(ctx, QStringList(QString::fromUtf8(fpr))); 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); const Error err = ctx->exportPublicKeys(pc.patterns(), data);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMEDownloadJob::start(const QStringList &pats)
@ -95,7 +92,7 @@ Error QGpgMEDownloadJob::start(const QStringList &pats)
return Error(); 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); run(bind(&download, _1, _2, fpr, _3), keyData);
return Error(); return Error();

View File

@ -45,7 +45,7 @@ class QGpgMEDownloadJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public DownloadJob : public DownloadJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT
@ -61,7 +61,7 @@ public:
GpgME::Error start(const QStringList &fingerprints) Q_DECL_OVERRIDE; GpgME::Error start(const QStringList &fingerprints) Q_DECL_OVERRIDE;
/*! \reimp from DownloadJob */ /*! \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;
}; };
} }

View File

@ -65,14 +65,14 @@ void QGpgMEEncryptJob::setOutputIsBase64Encoded(bool on)
static QGpgMEEncryptJob::result_type encrypt(Context *ctx, QThread *thread, static QGpgMEEncryptJob::result_type encrypt(Context *ctx, QThread *thread,
const std::vector<Key> &recipients, const std::vector<Key> &recipients,
const weak_ptr<QIODevice> &plainText_, const std::weak_ptr<QIODevice> &plainText_,
const weak_ptr<QIODevice> &cipherText_, const std::weak_ptr<QIODevice> &cipherText_,
bool alwaysTrust, bool alwaysTrust,
bool outputIsBsse64Encoded) bool outputIsBsse64Encoded)
{ {
const shared_ptr<QIODevice> plainText = plainText_.lock(); const std::shared_ptr<QIODevice> plainText = plainText_.lock();
const shared_ptr<QIODevice> cipherText = cipherText_.lock(); const std::shared_ptr<QIODevice> cipherText = cipherText_.lock();
const _detail::ToThreadMover ctMover(cipherText, thread); const _detail::ToThreadMover ctMover(cipherText, thread);
const _detail::ToThreadMover ptMover(plainText, 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); const EncryptionResult res = ctx->encrypt(recipients, indata, outdata, eflags);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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 { } else {
QGpgME::QIODeviceDataProvider out(cipherText); QGpgME::QIODeviceDataProvider out(cipherText);
Data outdata(&out); 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); const EncryptionResult res = ctx->encrypt(recipients, indata, outdata, eflags);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) 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); buffer->setData(plainText);
if (!buffer->open(QIODevice::ReadOnly)) { if (!buffer->open(QIODevice::ReadOnly)) {
assert(!"This should never happen: QBuffer::open() failed"); 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) 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(); 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, run(boost::bind(&encrypt,
_1, _2, _1, _2,

View File

@ -56,7 +56,7 @@ class QGpgMEEncryptJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public EncryptJob : public EncryptJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT
@ -74,8 +74,8 @@ public:
/*! \reimp from EncryptJob */ /*! \reimp from EncryptJob */
void start(const std::vector<GpgME::Key> &recipients, void start(const std::vector<GpgME::Key> &recipients,
const boost::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &plainText,
const boost::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &cipherText,
bool alwaysTrust) Q_DECL_OVERRIDE; bool alwaysTrust) Q_DECL_OVERRIDE;
/*! \reimp from EncryptJob */ /*! \reimp from EncryptJob */
@ -83,9 +83,6 @@ public:
const QByteArray &plainText, bool alwaysTrust, const QByteArray &plainText, bool alwaysTrust,
QByteArray &cipherText) Q_DECL_OVERRIDE; QByteArray &cipherText) Q_DECL_OVERRIDE;
/*! \reimp from Job */
void showErrorDialog(QWidget *parent, const QString &caption) const Q_DECL_OVERRIDE;
/*! \reimp from EncryptJob */ /*! \reimp from EncryptJob */
void setOutputIsBase64Encoded(bool on) Q_DECL_OVERRIDE; void setOutputIsBase64Encoded(bool on) Q_DECL_OVERRIDE;

View File

@ -66,7 +66,7 @@ static QGpgMEExportJob::result_type export_qba(Context *ctx, const QStringList &
const Error err = ctx->exportPublicKeys(pc.patterns(), data); const Error err = ctx->exportPublicKeys(pc.patterns(), data);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMEExportJob::start(const QStringList &patterns)

View File

@ -45,7 +45,7 @@ class QGpgMEExportJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public ExportJob : public ExportJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT

View File

@ -58,7 +58,7 @@ static QGpgMEImportFromKeyserverJob::result_type importfromkeyserver(Context *ct
const ImportResult res = ctx->importKeys(keys); const ImportResult res = ctx->importKeys(keys);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMEImportFromKeyserverJob::start(const std::vector<Key> &keys)

View File

@ -51,7 +51,7 @@ class QGpgMEImportFromKeyserverJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public ImportFromKeyserverJob : public ImportFromKeyserverJob
#else #else
: public _detail::ThreadedJobMixin<ImportFromKeyserverJob, boost::tuple<GpgME::ImportResult, QString, GpgME::Error> > : public _detail::ThreadedJobMixin<ImportFromKeyserverJob, std::tuple<GpgME::ImportResult, QString, GpgME::Error> >
#endif #endif
{ {
Q_OBJECT Q_OBJECT

View File

@ -61,7 +61,7 @@ static QGpgMEImportJob::result_type import_qba(Context *ctx, const QByteArray &c
const ImportResult res = ctx->importKeys(data); const ImportResult res = ctx->importKeys(data);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMEImportJob::start(const QByteArray &certData)

View File

@ -51,7 +51,7 @@ class QGpgMEImportJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public ImportJob : public ImportJob
#else #else
: public _detail::ThreadedJobMixin<ImportJob, boost::tuple<GpgME::ImportResult, QString, GpgME::Error> > : public _detail::ThreadedJobMixin<ImportJob, std::tuple<GpgME::ImportResult, QString, GpgME::Error> >
#endif #endif
{ {
Q_OBJECT Q_OBJECT

View File

@ -61,7 +61,7 @@ static QGpgMEKeyGenerationJob::result_type generate_key(Context *ctx, const QStr
const KeyGenerationResult res = ctx->generateKey(parameters.toUtf8().constData(), data); const KeyGenerationResult res = ctx->generateKey(parameters.toUtf8().constData(), data);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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 &parameters) Error QGpgMEKeyGenerationJob::start(const QString &parameters)

View File

@ -51,7 +51,7 @@ class QGpgMEKeyGenerationJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public KeyGenerationJob : public KeyGenerationJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT

View File

@ -85,7 +85,7 @@ static QGpgMEKeyListJob::result_type list_keys(Context *ctx, QStringList pats, b
if (pats.size() < 2) { if (pats.size() < 2) {
std::vector<Key> keys; std::vector<Key> keys;
const KeyListResult r = do_list_keys(ctx, pats, keys, secretOnly); 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 // The communication channel between gpgme and gpgsm is limited in
@ -110,14 +110,14 @@ retry:
if (chunkSize < 1) if (chunkSize < 1)
// chunks smaller than one can't be -> return the error. // 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 { } else {
goto retry; goto retry;
} }
} else if (this_result.error().code() == GPG_ERR_EOF) { } else if (this_result.error().code() == GPG_ERR_EOF) {
// early end of keylisting (can happen when ~/.gnupg doesn't // early end of keylisting (can happen when ~/.gnupg doesn't
// exist). Fakeing an empty result: // 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... // ok, that seemed to work...
result.mergeWith(this_result); result.mergeWith(this_result);
@ -126,7 +126,7 @@ retry:
} }
pats = pats.mid(chunkSize); pats = pats.mid(chunkSize);
} while (!pats.empty()); } 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) Error QGpgMEKeyListJob::start(const QStringList &patterns, bool secretOnly)

View File

@ -56,7 +56,7 @@ class QGpgMEKeyListJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public KeyListJob : public KeyListJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT
@ -74,9 +74,6 @@ public:
/*! \reimp from KeyListJob */ /*! \reimp from KeyListJob */
GpgME::KeyListResult exec(const QStringList &patterns, bool secretOnly, std::vector<GpgME::Key> &keys) Q_DECL_OVERRIDE; 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 */ /*! \reimp from ThreadedJobMixin */
void resultHook(const result_type &result) Q_DECL_OVERRIDE; void resultHook(const result_type &result) Q_DECL_OVERRIDE;

View File

@ -132,7 +132,7 @@ static QGpgMEListAllKeysJob::result_type list_keys(Context *ctx, bool mergeKeys)
} else { } else {
merged.swap(pub); 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) Error QGpgMEListAllKeysJob::start(bool mergeKeys)

View File

@ -56,7 +56,7 @@ class QGpgMEListAllKeysJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public ListAllKeysJob : public ListAllKeysJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT

View File

@ -109,7 +109,7 @@ void QGpgMENewCryptoConfig::reloadConfiguration(bool showErrors)
} }
#endif #endif
BOOST_FOREACH(const Component & c, components) { BOOST_FOREACH(const Component & c, components) {
const shared_ptr<QGpgMENewCryptoConfigComponent> comp(new QGpgMENewCryptoConfigComponent); const std::shared_ptr<QGpgMENewCryptoConfigComponent> comp(new QGpgMENewCryptoConfigComponent);
comp->setComponent(c); comp->setComponent(c);
m_componentsByName[ comp->name() ] = comp; m_componentsByName[ comp->name() ] = comp;
} }
@ -138,7 +138,7 @@ QGpgMENewCryptoConfigComponent *QGpgMENewCryptoConfig::component(const QString &
void QGpgMENewCryptoConfig::sync(bool runtime) 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); c->sync(runtime);
} }
@ -164,7 +164,7 @@ void QGpgMENewCryptoConfigComponent::setComponent(const Component &component)
m_component = component; m_component = component;
m_groupsByName.clear(); m_groupsByName.clear();
shared_ptr<QGpgMENewCryptoConfigGroup> group; std::shared_ptr<QGpgMENewCryptoConfigGroup> group;
const std::vector<Option> options = m_component.options(); const std::vector<Option> options = m_component.options();
BOOST_FOREACH(const Option & o, 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)); group.reset(new QGpgMENewCryptoConfigGroup(shared_from_this(), o));
} else if (group) { } 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(); const QString name = entry->name();
group->m_entryNames.push_back(name); group->m_entryNames.push_back(name);
group->m_entriesByName[name] = entry; 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(), : CryptoConfigGroup(),
m_component(comp), m_component(comp),
m_option(option) m_option(option)
@ -252,7 +252,7 @@ QString QGpgMENewCryptoConfigGroup::description() const
QString QGpgMENewCryptoConfigGroup::path() 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(); return c->name() + QLatin1Char('/') + name();
} else { } else {
return QString(); 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) : m_group(group), m_option(option)
{ {
} }
@ -387,7 +387,7 @@ QString QGpgMENewCryptoConfigEntry::description() const
QString QGpgMENewCryptoConfigEntry::path() 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(); return g->path() + QLatin1Char('/') + name();
} else { } else {
return QString(); return QString();

View File

@ -62,7 +62,7 @@ class QGpgMENewCryptoConfigEntry;
class QGpgMENewCryptoConfigEntry : public QGpgME::CryptoConfigEntry class QGpgMENewCryptoConfigEntry : public QGpgME::CryptoConfigEntry
{ {
public: 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(); ~QGpgMENewCryptoConfigEntry();
QString name() const Q_DECL_OVERRIDE; QString name() const Q_DECL_OVERRIDE;
@ -106,14 +106,14 @@ protected:
QString toString(bool escape) const; QString toString(bool escape) const;
#endif #endif
private: private:
boost::weak_ptr<QGpgMENewCryptoConfigGroup> m_group; std::weak_ptr<QGpgMENewCryptoConfigGroup> m_group;
GpgME::Configuration::Option m_option; GpgME::Configuration::Option m_option;
}; };
class QGpgMENewCryptoConfigGroup : public QGpgME::CryptoConfigGroup class QGpgMENewCryptoConfigGroup : public QGpgME::CryptoConfigGroup
{ {
public: 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(); ~QGpgMENewCryptoConfigGroup();
QString name() const Q_DECL_OVERRIDE; QString name() const Q_DECL_OVERRIDE;
@ -129,14 +129,14 @@ public:
private: private:
friend class QGpgMENewCryptoConfigComponent; // it adds the entries friend class QGpgMENewCryptoConfigComponent; // it adds the entries
boost::weak_ptr<QGpgMENewCryptoConfigComponent> m_component; std::weak_ptr<QGpgMENewCryptoConfigComponent> m_component;
GpgME::Configuration::Option m_option; GpgME::Configuration::Option m_option;
QStringList m_entryNames; 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 /// 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: public:
QGpgMENewCryptoConfigComponent(); QGpgMENewCryptoConfigComponent();
@ -157,7 +157,7 @@ public:
private: private:
GpgME::Configuration::Component m_component; 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); void reloadConfiguration(bool showErrors);
private: private:
QHash< QString, boost::shared_ptr<QGpgMENewCryptoConfigComponent> > m_componentsByName; QHash< QString, std::shared_ptr<QGpgMENewCryptoConfigComponent> > m_componentsByName;
bool m_parsed; bool m_parsed;
}; };

View File

@ -64,10 +64,10 @@ void QGpgMESignEncryptJob::setOutputIsBase64Encoded(bool on)
mOutputIsBase64Encoded = 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 std::shared_ptr<QIODevice> &plainText = plainText_.lock();
const shared_ptr<QIODevice> &cipherText = cipherText_.lock(); const std::shared_ptr<QIODevice> &cipherText = cipherText_.lock();
const _detail::ToThreadMover ctMover(cipherText, thread); const _detail::ToThreadMover ctMover(cipherText, thread);
const _detail::ToThreadMover ptMover(plainText, 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) Q_FOREACH (const Key &signer, signers)
if (!signer.isNull()) if (!signer.isNull())
if (const Error err = ctx->addSigningKey(signer)) { 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) { 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); const std::pair<SigningResult, EncryptionResult> res = ctx->signAndEncrypt(recipients, indata, outdata, eflags);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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 { } else {
QGpgME::QIODeviceDataProvider out(cipherText); QGpgME::QIODeviceDataProvider out(cipherText);
Data outdata(&out); 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); const std::pair<SigningResult, EncryptionResult> res = ctx->signAndEncrypt(recipients, indata, outdata, eflags);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) 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); buffer->setData(plainText);
if (!buffer->open(QIODevice::ReadOnly)) { if (!buffer->open(QIODevice::ReadOnly)) {
assert(!"This should never happen: QBuffer::open() failed"); 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) 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(); 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); run(boost::bind(&sign_encrypt, _1, _2, signers, recipients, _3, _4, alwaysTrust, mOutputIsBase64Encoded), plainText, cipherText);
} }

View File

@ -63,7 +63,7 @@ class QGpgMESignEncryptJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public SignEncryptJob : public SignEncryptJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT
@ -83,8 +83,8 @@ public:
/*! \reimp from SignEncryptJob */ /*! \reimp from SignEncryptJob */
void start(const std::vector<GpgME::Key> &signers, void start(const std::vector<GpgME::Key> &signers,
const std::vector<GpgME::Key> &recipients, const std::vector<GpgME::Key> &recipients,
const boost::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &plainText,
const boost::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &cipherText,
bool alwaysTrust) Q_DECL_OVERRIDE; bool alwaysTrust) Q_DECL_OVERRIDE;
std::pair<GpgME::SigningResult, GpgME::EncryptionResult> std::pair<GpgME::SigningResult, GpgME::EncryptionResult>

View File

@ -65,14 +65,14 @@ void QGpgMESignJob::setOutputIsBase64Encoded(bool on)
static QGpgMESignJob::result_type sign(Context *ctx, QThread *thread, static QGpgMESignJob::result_type sign(Context *ctx, QThread *thread,
const std::vector<Key> &signers, const std::vector<Key> &signers,
const weak_ptr<QIODevice> &plainText_, const std::weak_ptr<QIODevice> &plainText_,
const weak_ptr<QIODevice> &signature_, const std::weak_ptr<QIODevice> &signature_,
SignatureMode mode, SignatureMode mode,
bool outputIsBsse64Encoded) bool outputIsBsse64Encoded)
{ {
const shared_ptr<QIODevice> plainText = plainText_.lock(); const std::shared_ptr<QIODevice> plainText = plainText_.lock();
const shared_ptr<QIODevice> signature = signature_.lock(); const std::shared_ptr<QIODevice> signature = signature_.lock();
const _detail::ToThreadMover ptMover(plainText, thread); const _detail::ToThreadMover ptMover(plainText, thread);
const _detail::ToThreadMover sgMover(signature, 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) Q_FOREACH (const Key &signer, signers)
if (!signer.isNull()) if (!signer.isNull())
if (const Error err = ctx->addSigningKey(signer)) { 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) { if (!signature) {
@ -98,7 +98,7 @@ static QGpgMESignJob::result_type sign(Context *ctx, QThread *thread,
const SigningResult res = ctx->sign(indata, outdata, mode); const SigningResult res = ctx->sign(indata, outdata, mode);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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 { } else {
QGpgME::QIODeviceDataProvider out(signature); QGpgME::QIODeviceDataProvider out(signature);
Data outdata(&out); Data outdata(&out);
@ -110,7 +110,7 @@ static QGpgMESignJob::result_type sign(Context *ctx, QThread *thread,
const SigningResult res = ctx->sign(indata, outdata, mode); const SigningResult res = ctx->sign(indata, outdata, mode);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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, SignatureMode mode,
bool outputIsBsse64Encoded) bool outputIsBsse64Encoded)
{ {
const shared_ptr<QBuffer> buffer(new QBuffer); const std::shared_ptr<QBuffer> buffer(new QBuffer);
buffer->setData(plainText); buffer->setData(plainText);
if (!buffer->open(QIODevice::ReadOnly)) { if (!buffer->open(QIODevice::ReadOnly)) {
assert(!"This should never happen: QBuffer::open() failed"); 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) 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(); 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); run(boost::bind(&sign, _1, _2, signers, _3, _4, mode, mOutputIsBase64Encoded), plainText, signature);
} }

View File

@ -56,7 +56,7 @@ class QGpgMESignJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public SignJob : public SignJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT
@ -75,8 +75,8 @@ public:
/*! \reimp from SignJob */ /*! \reimp from SignJob */
void start(const std::vector<GpgME::Key> &signers, void start(const std::vector<GpgME::Key> &signers,
const boost::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &plainText,
const boost::shared_ptr<QIODevice> &signature, const std::shared_ptr<QIODevice> &signature,
GpgME::SignatureMode mode) Q_DECL_OVERRIDE; GpgME::SignatureMode mode) Q_DECL_OVERRIDE;
/*! \reimp from SignJob */ /*! \reimp from SignJob */

View File

@ -74,12 +74,12 @@ static QGpgMESignKeyJob::result_type sign_key(Context *ctx, const Key &key, cons
if (!signer.isNull()) if (!signer.isNull())
if (const Error err = ctx->addSigningKey(signer)) { 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); const Error err = ctx->edit(key, ei, data);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) Error QGpgMESignKeyJob::start(const Key &key)

View File

@ -55,10 +55,10 @@ QGpgMEVerifyDetachedJob::QGpgMEVerifyDetachedJob(Context *context)
QGpgMEVerifyDetachedJob::~QGpgMEVerifyDetachedJob() {} 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 std::shared_ptr<QIODevice> signature = signature_.lock();
const shared_ptr<QIODevice> signedData = signedData_.lock(); const std::shared_ptr<QIODevice> signedData = signedData_.lock();
const _detail::ToThreadMover sgMover(signature, thread); const _detail::ToThreadMover sgMover(signature, thread);
const _detail::ToThreadMover sdMover(signedData, thread); const _detail::ToThreadMover sdMover(signedData, thread);
@ -73,7 +73,7 @@ static QGpgMEVerifyDetachedJob::result_type verify_detached(Context *ctx, QThrea
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) 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; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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(); 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); run(bind(&verify_detached, _1, _2, _3, _4), signature, signedData);
} }

View File

@ -51,7 +51,7 @@ class QGpgMEVerifyDetachedJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public VerifyDetachedJob : public VerifyDetachedJob
#else #else
: public _detail::ThreadedJobMixin<VerifyDetachedJob, boost::tuple<GpgME::VerificationResult, QString, GpgME::Error> > : public _detail::ThreadedJobMixin<VerifyDetachedJob, std::tuple<GpgME::VerificationResult, QString, GpgME::Error> >
#endif #endif
{ {
Q_OBJECT Q_OBJECT
@ -67,7 +67,7 @@ public:
GpgME::Error start(const QByteArray &signature, const QByteArray &signedData) Q_DECL_OVERRIDE; GpgME::Error start(const QByteArray &signature, const QByteArray &signedData) Q_DECL_OVERRIDE;
/*! \reimp from VerifyDetachedJob */ /*! \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 */ /*! \reimp from VerifyDetachedJob */
GpgME::VerificationResult exec(const QByteArray &signature, GpgME::VerificationResult exec(const QByteArray &signature,

View File

@ -57,11 +57,11 @@ QGpgMEVerifyOpaqueJob::QGpgMEVerifyOpaqueJob(Context *context)
QGpgMEVerifyOpaqueJob::~QGpgMEVerifyOpaqueJob() {} 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 std::shared_ptr<QIODevice> plainText = plainText_.lock();
const shared_ptr<QIODevice> signedData = signedData_.lock(); const std::shared_ptr<QIODevice> signedData = signedData_.lock();
const _detail::ToThreadMover ptMover(plainText, thread); const _detail::ToThreadMover ptMover(plainText, thread);
const _detail::ToThreadMover sdMover(signedData, 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); const VerificationResult res = ctx->verifyOpaqueSignature(indata, outdata);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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 { } else {
QGpgME::QIODeviceDataProvider out(plainText); QGpgME::QIODeviceDataProvider out(plainText);
Data outdata(&out); Data outdata(&out);
@ -84,19 +84,19 @@ static QGpgMEVerifyOpaqueJob::result_type verify_opaque(Context *ctx, QThread *t
const VerificationResult res = ctx->verifyOpaqueSignature(indata, outdata); const VerificationResult res = ctx->verifyOpaqueSignature(indata, outdata);
Error ae; Error ae;
const QString log = _detail::audit_log_as_html(ctx, 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) 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); buffer->setData(signedData);
if (!buffer->open(QIODevice::ReadOnly)) { if (!buffer->open(QIODevice::ReadOnly)) {
assert(!"This should never happen: QBuffer::open() failed"); 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) Error QGpgMEVerifyOpaqueJob::start(const QByteArray &signedData)
@ -105,7 +105,7 @@ Error QGpgMEVerifyOpaqueJob::start(const QByteArray &signedData)
return Error(); 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); run(bind(&verify_opaque, _1, _2, _3, _4), signedData, plainText);
} }

View File

@ -51,7 +51,7 @@ class QGpgMEVerifyOpaqueJob
#ifdef Q_MOC_RUN #ifdef Q_MOC_RUN
: public VerifyOpaqueJob : public VerifyOpaqueJob
#else #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 #endif
{ {
Q_OBJECT Q_OBJECT
@ -67,7 +67,7 @@ public:
GpgME::Error start(const QByteArray &signedData) Q_DECL_OVERRIDE; GpgME::Error start(const QByteArray &signedData) Q_DECL_OVERRIDE;
/*! \reimp from VerifyOpaqueJob */ /*! \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 */ /*! \reimp form VerifyOpaqueJob */
GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainData) Q_DECL_OVERRIDE; GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainData) Q_DECL_OVERRIDE;

View File

@ -108,8 +108,8 @@ public:
*/ */
virtual void start(const std::vector<GpgME::Key> &signers, virtual void start(const std::vector<GpgME::Key> &signers,
const std::vector<GpgME::Key> &recipients, const std::vector<GpgME::Key> &recipients,
const boost::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &plainText,
const boost::shared_ptr<QIODevice> &cipherText = boost::shared_ptr<QIODevice>(), const std::shared_ptr<QIODevice> &cipherText = std::shared_ptr<QIODevice>(),
bool alwaysTrust = false) = 0; bool alwaysTrust = false) = 0;
virtual std::pair<GpgME::SigningResult, GpgME::EncryptionResult> virtual std::pair<GpgME::SigningResult, GpgME::EncryptionResult>

View File

@ -98,8 +98,8 @@ public:
\throws GpgME::Exception if starting fails \throws GpgME::Exception if starting fails
*/ */
virtual void start(const std::vector<GpgME::Key> &signers, virtual void start(const std::vector<GpgME::Key> &signers,
const boost::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &plainText,
const boost::shared_ptr<QIODevice> &signature, const std::shared_ptr<QIODevice> &signature,
GpgME::SignatureMode mode) = 0; GpgME::SignatureMode mode) = 0;
virtual GpgME::SigningResult exec(const std::vector<GpgME::Key> &signers, virtual GpgME::SigningResult exec(const std::vector<GpgME::Key> &signers,

View File

@ -86,7 +86,7 @@ class ToThreadMover
public: public:
ToThreadMover(QObject *o, QThread *t) : m_object(o), m_thread(t) {} ToThreadMover(QObject *o, QThread *t) : m_object(o), m_thread(t) {}
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() ~ToThreadMover()
{ {
if (m_object && m_thread) { if (m_object && m_thread) {
@ -124,7 +124,7 @@ private:
T_result m_result; 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 class ThreadedJobMixin : public T_base, public GpgME::ProgressProvider
{ {
public: public:
@ -132,20 +132,20 @@ public:
typedef T_result result_type; typedef T_result result_type;
protected: 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_STATIC_ASSERT((
boost::is_same < std::is_same <
typename boost::tuples::element < typename std::tuple_element <
boost::tuples::length<T_result>::value - 2, std::tuple_size<T_result>::value - 2,
T_result T_result
>::type, >::type,
QString QString
>::value >::value
)); ));
BOOST_STATIC_ASSERT(( BOOST_STATIC_ASSERT((
boost::is_same < std::is_same <
typename boost::tuples::element < typename std::tuple_element <
boost::tuples::length<T_result>::value - 1, std::tuple_size<T_result>::value - 1,
T_result T_result
>::type, >::type,
GpgME::Error GpgME::Error
@ -172,7 +172,7 @@ protected:
m_thread.start(); m_thread.start();
} }
template <typename T_binder> 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) { if (io) {
io->moveToThread(&m_thread); io->moveToThread(&m_thread);
@ -180,12 +180,12 @@ protected:
// the arguments passed here to the functor are stored in a QThread, and are not // 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 // 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. // is emitted and the signal receiver wants to clean up IO devices.
// To avoid such races, we pass weak_ptr's to the functor. // To avoid such races, we pass std::weak_ptr's to the functor.
m_thread.setFunction(boost::bind(func, this->context(), this->thread(), boost::weak_ptr<QIODevice>(io))); m_thread.setFunction(boost::bind(func, this->context(), this->thread(), std::weak_ptr<QIODevice>(io)));
m_thread.start(); m_thread.start();
} }
template <typename T_binder> 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) { if (io1) {
io1->moveToThread(&m_thread); io1->moveToThread(&m_thread);
@ -196,8 +196,8 @@ protected:
// the arguments passed here to the functor are stored in a QThread, and are not // 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 // 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. // is emitted and the signal receiver wants to clean up IO devices.
// To avoid such races, we pass weak_ptr's to the functor. // To avoid such races, we pass std::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))); m_thread.setFunction(boost::bind(func, this->context(), this->thread(), std::weak_ptr<QIODevice>(io1), std::weak_ptr<QIODevice>(io2)));
m_thread.start(); m_thread.start();
} }
GpgME::Context *context() const GpgME::Context *context() const
@ -210,8 +210,8 @@ protected:
void slotFinished() void slotFinished()
{ {
const T_result r = m_thread.result(); const T_result r = m_thread.result();
m_auditLog = boost::get < boost::tuples::length<T_result>::value - 2 > (r); m_auditLog = std::get < std::tuple_size<T_result>::value - 2 > (r);
m_auditLogError = boost::get < boost::tuples::length<T_result>::value - 1 > (r); m_auditLogError = std::get < std::tuple_size<T_result>::value - 1 > (r);
resultHook(r); resultHook(r);
Q_EMIT this->done(); Q_EMIT this->done();
doEmitResult(r); doEmitResult(r);
@ -244,31 +244,31 @@ protected:
} }
private: private:
template <typename T1, typename T2> 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> 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> 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> 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: private:
boost::shared_ptr<GpgME::Context> m_ctx; std::shared_ptr<GpgME::Context> m_ctx;
Thread<T_result> m_thread; Thread<T_result> m_thread;
QString m_auditLog; QString m_auditLog;
GpgME::Error m_auditLogError; GpgME::Error m_auditLogError;

View File

@ -84,7 +84,7 @@ public:
\throws GpgME::Exception if starting fails. \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, virtual GpgME::VerificationResult exec(const QByteArray &signature,
const QByteArray &signedData) = 0; const QByteArray &signedData) = 0;

View File

@ -87,7 +87,7 @@ public:
\throws GpgME::Exception if starting fails \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 */ /** Synchronous version of @ref start */
virtual GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainText) = 0; virtual GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainText) = 0;