Commit 3fce3817 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Downloads Plugin] Update existing job when being signalled creation of existing job

This is in preparation for allowing for Firefox to suspend download jobs which makes a suspend to as look like a cancellation.

Differential Revision: https://phabricator.kde.org/D21476
parent f3dcb644
......@@ -53,7 +53,14 @@ void DownloadPlugin::handleData(const QString& event, const QJsonObject& payload
}
if (event == QLatin1String("created")) {
auto *job = new DownloadJob(id);
// If we get a created event for an already existing job, update it instead
auto *job = m_jobs.value(id);
if (job) {
job->update(download);
return;
}
job = new DownloadJob(id);
// first register and then update, otherwise we miss the initial population..
KIO::getJobTracker()->registerJob(job);
......
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