Commit d5c6a12a authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Session: connect to KJob::finished() rather than result()

KJob::result() is not emitted when job is killed quietly which prevents
Session from scheduling the next job until the killed job is destroyed.
This leads to responses being delivered to a wrong job when the job is
killed.

BUG: 364005
CCMAIL: faure@kde.org
parent acc0def7
......@@ -64,6 +64,8 @@ void JobPrivate::handleResponse(qint64 tag, const Protocol::Command &response)
if (mReadingFinished) {
qCWarning(AKONADICORE_LOG) << "Received response for a job that does not expect any more data, ignoring";
qCDebug(AKONADICORE_LOG) << "Response tag:" << tag << ", response type:" << response.type();
qCDebug(AKONADICORE_LOG) << "Job tag:" << mTag << "job:" << q;
Q_ASSERT(!mReadingFinished);
return;
}
......
......@@ -247,7 +247,7 @@ void SessionPrivate::jobDestroyed(QObject *job)
void SessionPrivate::addJob(Job *job)
{
queue.append(job);
QObject::connect(job, SIGNAL(result(KJob*)), mParent, SLOT(jobDone(KJob*)));
QObject::connect(job, SIGNAL(finished(KJob*)), mParent, SLOT(jobDone(KJob*)));
QObject::connect(job, SIGNAL(writeFinished(Akonadi::Job*)), mParent, SLOT(jobWriteFinished(Akonadi::Job*)));
QObject::connect(job, SIGNAL(destroyed(QObject*)), mParent, SLOT(jobDestroyed(QObject*)));
startNext();
......
Supports Markdown
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