Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9386122e authored by Laurent Montel's avatar Laurent Montel 😁

Port to new connect api

parent 4cb15796
......@@ -109,9 +109,14 @@ void SessionThread::doDestroy()
// Called in main thread
void SessionThread::connectToHost(const QUrl &url)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, [this, url]() { doConnectToHost(url); }, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "doConnectToHost",
Qt::QueuedConnection,
Q_ARG(QUrl, url));
#endif
}
// Called in secondary thread
......@@ -130,9 +135,13 @@ void SessionThread::doConnectToHost(const QUrl &url)
// Called in main thread
void SessionThread::disconnectFromHost(bool sendLogout)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, [this, sendLogout]() { doDisconnectFromHost(sendLogout); }, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "doDisconnectFromHost",
Qt::QueuedConnection,
Q_ARG(bool, sendLogout));
#endif
}
// Called in secondary thread
......@@ -149,9 +158,13 @@ void SessionThread::doDisconnectFromHost(bool sendLogout)
// Called in main thread
void SessionThread::sendData(const QByteArray &data)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, [this, data]() { doSendData(data); }, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "doSendData",
Qt::QueuedConnection,
Q_ARG(QByteArray, data));
#endif
}
// Called in secondary thread
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment