Commit c4dcba89 authored by David Edmundson's avatar David Edmundson

[kuiserver] Avoid double warning on terminated jobs

Summary:
When a job is terminated, it isn't necessarily removed from the job
owners queue to handle pending requests.

If a service unregisters and the job is already finished, we don't want
to mark it as an error.

Test Plan:
kioclient5 (when running with fixed interactive-ness) quits when there's an error.
We used to always show the client died error.

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D17711
parent 2beb1a0a
......@@ -53,6 +53,7 @@ JobView::~JobView()
void JobView::terminate(const QString &errorMessage)
{
qDebug() << "is terminated" << errorMessage;
QDBusConnection::sessionBus().unregisterObject(m_objectPath.path(), QDBusConnection::UnregisterTree);
typedef QPair<QString, QDBusAbstractInterface*> iFacePair;
......@@ -77,6 +78,11 @@ void JobView::terminate(const QString &errorMessage)
m_isTerminated = true;
}
bool JobView::isTerminated() const
{
return m_isTerminated;
}
void JobView::requestSuspend()
{
emit suspendRequested();
......
......@@ -109,6 +109,7 @@ public:
QDBusObjectPath objectPath() const;
bool isTerminated() const;
/**
......
......@@ -325,6 +325,9 @@ void ProgressListModel::serviceUnregistered(const QString &name)
if (!jobs.isEmpty()) {
m_jobViewsOwners.remove(name);
Q_FOREACH(JobView *job, jobs) {
if (job->isTerminated()) {
continue;
}
job->setError(KIO::ERR_SLAVE_DIED);
job->terminate(job->errorText());
}
......
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