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

Port to new connect api

parent 56bfa972
......@@ -74,7 +74,11 @@ Connection::~Connection()
void Connection::reconnect()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
const bool ok = QMetaObject::invokeMethod(this, &Connection::doReconnect, Qt::QueuedConnection);
#else
const bool ok = QMetaObject::invokeMethod(this, "doReconnect", Qt::QueuedConnection);
#endif
Q_ASSERT(ok);
Q_UNUSED(ok)
}
......
......@@ -313,8 +313,11 @@ bool ItemModifyJob::doHandleResponse(qint64 tag, const Protocol::CommandPtr &res
handler->setConflictingItems(d->mItems.first(), d->mItems.first());
connect(handler, SIGNAL(conflictResolved()), SLOT(conflictResolved()));
connect(handler, SIGNAL(error(QString)), SLOT(conflictResolveError(QString)));
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(handler, &ConflictHandler::start, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(handler, "start", Qt::QueuedConnection);
#endif
return true;
}
}
......
......@@ -40,7 +40,11 @@ SessionThread::SessionThread(QObject *parent)
SessionThread::~SessionThread()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &SessionThread::doThreadQuit);
#else
QMetaObject::invokeMethod(this, "doThreadQuit");
#endif
if (!thread()->wait(10 * 1000)) {
thread()->terminate();
// Make sure to wait until it's done, otherwise it can crash when the pthread callback is called
......
......@@ -40,9 +40,13 @@ IntervalCheck::~IntervalCheck()
void IntervalCheck::requestCollectionSync(const Collection &collection)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, [this, collection]() { collectionExpired(collection); }, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "collectionExpired",
Qt::QueuedConnection,
Q_ARG(Collection, collection));
#endif
}
int IntervalCheck::collectionScheduleInterval(const Collection &collection)
......
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