Commit b9593a06 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Notifications] When application responds to cancel request, stop kill timer

This ensures that an error message the app might have sent in response to the
cancel request is still shown.

Also, while at it deduplicate code by calling into `terminate` from the
service watcher.
parent 3dc2b734
......@@ -265,6 +265,10 @@ void JobPrivate::finish()
return;
}
if (m_killTimer) {
m_killTimer->stop();
}
Job *job = static_cast<Job *>(parent());
// update timestamp
job->resetUpdated();
......
......@@ -482,15 +482,10 @@ void JobsModelPrivate::onServiceUnregistered(const QString &serviceName)
if (job->state() == Notifications::JobStateStopped) {
continue;
}
job->setError(KIO::ERR_OWNER_DIED);
job->setErrorText(i18n("Application closed unexpectedly."));
job->setState(Notifications::JobStateStopped);
// basically JobPrivate::finish()
// update timestamp
job->resetUpdated();
// when it was hidden in history, bring it up again
job->setDismissed(false);
job->d->terminate(KIO::ERR_OWNER_DIED,
i18n("Application closed unexpectedly."),
{} /*hints*/);
}
Q_ASSERT(!m_serviceWatcher->watchedServices().contains(serviceName));
......
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