Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/jobsmodel_p.cpp
Show All 26 Lines | |||||
27 | 27 | | |||
28 | #include "utils_p.h" | 28 | #include "utils_p.h" | ||
29 | 29 | | |||
30 | #include "kuiserveradaptor.h" | 30 | #include "kuiserveradaptor.h" | ||
31 | #include "jobviewserveradaptor.h" | 31 | #include "jobviewserveradaptor.h" | ||
32 | #include "jobviewserverv2adaptor.h" | 32 | #include "jobviewserverv2adaptor.h" | ||
33 | 33 | | |||
34 | #include <QDBusConnection> | 34 | #include <QDBusConnection> | ||
35 | #include <QDBusConnectionInterface> | ||||
36 | #include <QDBusMessage> | ||||
35 | #include <QDBusServiceWatcher> | 37 | #include <QDBusServiceWatcher> | ||
36 | 38 | | |||
37 | #include <KJob> | 39 | #include <KJob> | ||
38 | #include <KLocalizedString> | 40 | #include <KLocalizedString> | ||
39 | #include <KService> | 41 | #include <KService> | ||
40 | 42 | | |||
41 | #include <kio/global.h> | 43 | #include <kio/global.h> | ||
42 | 44 | | |||
▲ Show 20 Lines • Show All 295 Lines • ▼ Show 20 Line(s) | 236 | { | |||
338 | } else { | 340 | } else { | ||
339 | m_pendingJobViews.append(job); | 341 | m_pendingJobViews.append(job); | ||
340 | m_pendingJobViewsTimer->start(); | 342 | m_pendingJobViewsTimer->start(); | ||
341 | } | 343 | } | ||
342 | 344 | | |||
343 | m_jobServices.insert(job, serviceName); | 345 | m_jobServices.insert(job, serviceName); | ||
344 | m_serviceWatcher->addWatchedService(serviceName); | 346 | m_serviceWatcher->addWatchedService(serviceName); | ||
345 | 347 | | |||
348 | if (!connection().interface()->isServiceRegistered(serviceName)) { | ||||
349 | qCWarning(NOTIFICATIONMANAGER) << "Service that requested the view wasn't registered anymore by the time the request was being processed"; | ||||
350 | QMetaObject::invokeMethod(this, [this, serviceName] { | ||||
351 | onServiceUnregistered(serviceName); | ||||
352 | }, Qt::QueuedConnection); | ||||
353 | } | ||||
354 | | ||||
346 | return job->d->objectPath(); | 355 | return job->d->objectPath(); | ||
347 | } | 356 | } | ||
348 | 357 | | |||
349 | void JobsModelPrivate::remove(Job *job) | 358 | void JobsModelPrivate::remove(Job *job) | ||
350 | { | 359 | { | ||
351 | const int activeRow = m_jobViews.indexOf(job); | 360 | const int activeRow = m_jobViews.indexOf(job); | ||
352 | const int pendingRow = m_pendingJobViews.indexOf(job); | 361 | const int pendingRow = m_pendingJobViews.indexOf(job); | ||
353 | 362 | | |||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |