summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-01-08 08:56:41 +0100
committerLaurent Montel <[email protected]>2018-01-08 08:56:41 +0100
commit9386122ec6165b92519fb54fcbb255511ca32df9 (patch)
treea7478e2f01ad1662dcb409049396216453317ef7
parent4cb157967eaf22f7f4ed261e5a2aa2285ba035f1 (diff)
Port to new connect api
-rw-r--r--src/kmanagesieve/sessionthread.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/kmanagesieve/sessionthread.cpp b/src/kmanagesieve/sessionthread.cpp
index d28c31c..525b476 100644
--- a/src/kmanagesieve/sessionthread.cpp
+++ b/src/kmanagesieve/sessionthread.cpp
@@ -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