From afd8fad6e275e2f74b2ad045dce05d826986e2ec Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Mon, 11 Apr 2016 17:15:16 +0200 Subject: Qt: Remove remaining boost usage * lang/qt/src/dataprovider.h, lang/qt/src/decryptjob.h, lang/qt/src/decryptverifyjob.h, lang/qt/src/encryptjob.h, lang/qt/src/qgpgmeadduseridjob.cpp, lang/qt/src/qgpgmechangeexpiryjob.cpp, lang/qt/src/qgpgmechangeownertrustjob.cpp, lang/qt/src/qgpgmechangepasswdjob.cpp, lang/qt/src/qgpgmedecryptjob.cpp, lang/qt/src/qgpgmedecryptverifyjob.cpp, lang/qt/src/qgpgmedeletejob.cpp, lang/qt/src/qgpgmedownloadjob.cpp, lang/qt/src/qgpgmeencryptjob.cpp, lang/qt/src/qgpgmeexportjob.cpp, lang/qt/src/qgpgmeimportfromkeyserverjob.cpp, lang/qt/src/qgpgmeimportjob.cpp, lang/qt/src/qgpgmekeygenerationjob.cpp, lang/qt/src/qgpgmekeylistjob.cpp, lang/qt/src/qgpgmenewcryptoconfig.cpp, lang/qt/src/qgpgmenewcryptoconfig.h, lang/qt/src/qgpgmesignencryptjob.cpp, lang/qt/src/qgpgmesignjob.cpp, lang/qt/src/qgpgmesignkeyjob.cpp, lang/qt/src/qgpgmeverifydetachedjob.cpp, lang/qt/src/qgpgmeverifyopaquejob.cpp, lang/qt/src/signencryptjob.h, lang/qt/src/signjob.h, lang/qt/src/threadedjobmixin.cpp, lang/qt/src/threadedjobmixin.h, lang/qt/src/verifydetachedjob.h, lang/qt/src/verifyopaquejob.h: Remove boost usage. -- Mostly done with search and replace. --- lang/qt/src/threadedjobmixin.h | 54 ++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 31 deletions(-) (limited to 'lang/qt/src/threadedjobmixin.h') diff --git a/lang/qt/src/threadedjobmixin.h b/lang/qt/src/threadedjobmixin.h index 6bea871e..c6c96859 100644 --- a/lang/qt/src/threadedjobmixin.h +++ b/lang/qt/src/threadedjobmixin.h @@ -48,13 +48,6 @@ # include #endif -#include -#include -#include -#include -#include -#include -#include #include @@ -101,7 +94,7 @@ class Thread : public QThread public: explicit Thread(QObject *parent = Q_NULLPTR) : QThread(parent) {} - void setFunction(const boost::function &function) + void setFunction(const std::function &function) { const QMutexLocker locker(&m_mutex); m_function = function; @@ -120,7 +113,7 @@ private: } private: mutable QMutex m_mutex; - boost::function m_function; + std::function m_function; T_result m_result; }; @@ -132,25 +125,24 @@ public: typedef T_result result_type; protected: - BOOST_STATIC_ASSERT((std::tuple_size::value > 2)); - BOOST_STATIC_ASSERT(( - std::is_same < - typename std::tuple_element < - std::tuple_size::value - 2, - T_result - >::type, - QString - >::value - )); - BOOST_STATIC_ASSERT(( - std::is_same < - typename std::tuple_element < - std::tuple_size::value - 1, - T_result - >::type, - GpgME::Error - >::value - )); + static_assert(std::tuple_size::value > 2, + "Result tuple too small"); + static_assert(std::is_same < + typename std::tuple_element < + std::tuple_size::value - 2, + T_result + >::type, + QString + >::value, + "Second to last result type not a QString"); + static_assert(std::is_same < + typename std::tuple_element < + std::tuple_size::value - 1, + T_result + >::type, + GpgME::Error + >::value, + "Last result type not a GpgME::Error"); explicit ThreadedJobMixin(GpgME::Context *ctx) : T_base(0), m_ctx(ctx), m_thread(), m_auditLog(), m_auditLogError() @@ -168,7 +160,7 @@ protected: template void run(const T_binder &func) { - m_thread.setFunction(boost::bind(func, this->context())); + m_thread.setFunction(std::bind(func, this->context())); m_thread.start(); } template @@ -181,7 +173,7 @@ protected: // necessarily destroyed (living outside the UI thread) at the time the result signal // is emitted and the signal receiver wants to clean up IO devices. // To avoid such races, we pass std::weak_ptr's to the functor. - m_thread.setFunction(boost::bind(func, this->context(), this->thread(), std::weak_ptr(io))); + m_thread.setFunction(std::bind(func, this->context(), this->thread(), std::weak_ptr(io))); m_thread.start(); } template @@ -197,7 +189,7 @@ protected: // necessarily destroyed (living outside the UI thread) at the time the result signal // is emitted and the signal receiver wants to clean up IO devices. // To avoid such races, we pass std::weak_ptr's to the functor. - m_thread.setFunction(boost::bind(func, this->context(), this->thread(), std::weak_ptr(io1), std::weak_ptr(io2))); + m_thread.setFunction(std::bind(func, this->context(), this->thread(), std::weak_ptr(io1), std::weak_ptr(io2))); m_thread.start(); } GpgME::Context *context() const -- cgit v1.2.3