Removed ctor that constructed an invalid CSlot

This commit is contained in:
Mat Sutcliffe
2022-01-23 17:30:12 +00:00
parent 9bc4ec71b8
commit ebb82b38ee
2 changed files with 2 additions and 8 deletions

View File

@@ -747,7 +747,7 @@ namespace BlackCore
if (!fi.dir().exists()) { return nullptr; } if (!fi.dir().exists()) { return nullptr; }
// function called with reply when done // function called with reply when done
CallbackSlot callbackSlot([ = ](QNetworkReply * reply) CallbackSlot callbackSlot(this, [ = ](QNetworkReply * reply)
{ {
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(reply); QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(reply);
CStatusMessage msg; CStatusMessage msg;
@@ -769,9 +769,8 @@ namespace BlackCore
callback(msg); callback(msg);
}); });
}); });
callbackSlot.setObject(this); // object for thread
ProgressSlot progressSlot([ = ](int, qint64, qint64, const QUrl &) ProgressSlot progressSlot(this, [ = ](int, qint64, qint64, const QUrl &)
{ {
// so far not implemented // so far not implemented
}); });

View File

@@ -83,11 +83,6 @@ namespace BlackMisc
Q_ASSERT_X(object, Q_FUNC_INFO, "Need object"); Q_ASSERT_X(object, Q_FUNC_INFO, "Need object");
} }
//! Construct a slot from the given object passing a function
CSlot(std::function<R(Args...)> function) :
m_function(function)
{}
//! Construct a slot from the given object passing a function and a object //! Construct a slot from the given object passing a function and a object
template <typename T> template <typename T>
CSlot(T *object, std::function<R(Args...)> function) : CSlot(T *object, std::function<R(Args...)> function) :