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 565f4536 authored by Laurent Montel's avatar Laurent Montel 😁

Port new connect api

parent a9a7e646
......@@ -164,8 +164,14 @@ void Connection::doReconnect()
void Connection::forceReconnect()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
const bool ok = QMetaObject::invokeMethod(this, &Connection::doForceReconnect,
Qt::QueuedConnection);
#else
const bool ok = QMetaObject::invokeMethod(this, "doForceReconnect",
Qt::QueuedConnection);
#endif
Q_ASSERT(ok);
Q_UNUSED(ok)
}
......@@ -184,7 +190,13 @@ void Connection::doForceReconnect()
void Connection::closeConnection()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
const bool ok = QMetaObject::invokeMethod(this, &Connection::doCloseConnection,
Qt::QueuedConnection);
#else
const bool ok = QMetaObject::invokeMethod(this, "doCloseConnection", Qt::QueuedConnection);
#endif
Q_ASSERT(ok);
Q_UNUSED(ok)
}
......
......@@ -51,7 +51,11 @@ AkThread::~AkThread()
void AkThread::startThread()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
const bool init = QMetaObject::invokeMethod(this, &AkThread::init, Qt::QueuedConnection);
#else
const bool init = QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection);
#endif
Q_ASSERT(init);
Q_UNUSED(init);
}
......@@ -59,7 +63,12 @@ void AkThread::startThread()
void AkThread::quitThread()
{
qCDebug(AKONADISERVER_LOG) << "Shutting down" << objectName() << "...";
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
const bool invoke = QMetaObject::invokeMethod(this, &AkThread::quit, Qt::QueuedConnection);
#else
const bool invoke = QMetaObject::invokeMethod(this, "quit", Qt::QueuedConnection);
#endif
Q_ASSERT(invoke);
Q_UNUSED(invoke);
if (!thread()->wait(10 * 1000)) {
......
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