Commit 01333913 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Check if service is still registered before showing progress

Should Plasma be too busy to process a request and the app that requested it quit before Plasma processed it,
we will get a defunct job view that cannot be canceled because the app that owned it isn't listening anymore.

Differential Revision: https://phabricator.kde.org/D21180
parent 71dbe70d
......@@ -32,6 +32,8 @@
#include "jobviewserverv2adaptor.h"
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusMessage>
#include <QDBusServiceWatcher>
#include <KJob>
......@@ -343,6 +345,13 @@ QDBusObjectPath JobsModelPrivate::requestView(const QString &desktopEntry,
m_jobServices.insert(job, serviceName);
m_serviceWatcher->addWatchedService(serviceName);
if (!connection().interface()->isServiceRegistered(serviceName)) {
qCWarning(NOTIFICATIONMANAGER) << "Service that requested the view wasn't registered anymore by the time the request was being processed";
QMetaObject::invokeMethod(this, [this, serviceName] {
onServiceUnregistered(serviceName);
}, Qt::QueuedConnection);
}
return job->d->objectPath();
}
......
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