Commit 79c38652 authored by Laurent Montel's avatar Laurent Montel 😁

use new connect api

parent 33a2320b
......@@ -174,13 +174,21 @@ void Session::processResponse(const KManageSieve::Response &response, const QByt
if (m_currentJob) {
if (m_currentJob->d->handleResponse(response, data)) {
m_currentJob = nullptr;
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &Session::executeNextJob, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "executeNextJob", Qt::QueuedConnection);
#endif
}
break;
} else {
// we can get here in the kill current job case
if (response.operationResult() != Response::Other) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &Session::executeNextJob, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "executeNextJob", Qt::QueuedConnection);
#endif
return;
}
}
......@@ -192,7 +200,11 @@ void Session::scheduleJob(SieveJob *job)
{
qCDebug(KMANAGERSIEVE_LOG) << objectName() << Q_FUNC_INFO << job;
m_jobs.enqueue(job);
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &Session::executeNextJob, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "executeNextJob", Qt::QueuedConnection);
#endif
}
void Session::killJob(SieveJob *job, KJob::KillVerbosity verbosity)
......@@ -305,7 +317,11 @@ void Session::authenticationDone()
m_state = None;
m_connected = true;
qCDebug(KMANAGERSIEVE_LOG) << objectName() << "authentication done, ready to execute jobs";
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &Session::executeNextJob, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "executeNextJob", Qt::QueuedConnection);
#endif
}
void Session::sslError(const KSslErrorUiData &data)
......
......@@ -69,7 +69,11 @@ SessionThread::SessionThread(Session *session, QObject *parent)
SessionThread::~SessionThread()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &SessionThread::doDestroy, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "doDestroy", Qt::QueuedConnection);
#endif
if (!thread()->wait(10 * 1000)) {
thread()->terminate();
thread()->wait();
......@@ -219,8 +223,11 @@ void SessionThread::slotSocketError()
// Called in main thread
void SessionThread::startAuthentication()
{
QMetaObject::invokeMethod(this, "doStartAuthentication",
Qt::QueuedConnection);
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &SessionThread::doStartAuthentication, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "doStartAuthentication", Qt::QueuedConnection);
#endif
}
// Called in secondary thread
......@@ -406,8 +413,11 @@ bool SessionThread::saslClientStep(const QByteArray &challenge)
// Called in main thread
void SessionThread::startSsl()
{
QMetaObject::invokeMethod(this, "doStartSsl",
Qt::QueuedConnection);
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, &SessionThread::doStartSsl, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "doStartSsl", Qt::QueuedConnection);
#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