Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/jobsmodel_p.cpp
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Line(s) | 236 | { | |||
---|---|---|---|---|---|
260 | 260 | | |||
261 | job->setApplicationName(applicationName); | 261 | job->setApplicationName(applicationName); | ||
262 | job->setApplicationIconName(applicationIconName); | 262 | job->setApplicationIconName(applicationIconName); | ||
263 | 263 | | |||
264 | // No application name? Try to figure out the process name using the sender's PID | 264 | // No application name? Try to figure out the process name using the sender's PID | ||
265 | const QString serviceName = message().service(); | 265 | const QString serviceName = message().service(); | ||
266 | if (job->applicationName().isEmpty()) { | 266 | if (job->applicationName().isEmpty()) { | ||
267 | qCInfo(NOTIFICATIONMANAGER) << "JobView request from" << serviceName << "didn't contain any identification information, this is an application bug!"; | 267 | qCInfo(NOTIFICATIONMANAGER) << "JobView request from" << serviceName << "didn't contain any identification information, this is an application bug!"; | ||
268 | const QString processName = Utils::processNameFromDBusService(connection(), serviceName); | 268 | | ||
269 | QDBusReply<uint> pidReply = connection().interface()->servicePid(serviceName); | ||||
270 | if (pidReply.isValid()) { | ||||
271 | const auto pid = pidReply.value(); | ||||
272 | | ||||
273 | const QString processName = Utils::processNameFromPid(pid); | ||||
269 | if (!processName.isEmpty()) { | 274 | if (!processName.isEmpty()) { | ||
270 | qCDebug(NOTIFICATIONMANAGER) << "Resolved JobView request to be from" << processName; | 275 | qCDebug(NOTIFICATIONMANAGER) << "Resolved JobView request to be from" << processName; | ||
271 | job->setApplicationName(processName); | 276 | job->setApplicationName(processName); | ||
272 | } | 277 | } | ||
273 | } | 278 | } | ||
279 | } | ||||
274 | 280 | | |||
275 | job->setSuspendable(capabilities & KJob::Suspendable); | 281 | job->setSuspendable(capabilities & KJob::Suspendable); | ||
276 | job->setKillable(capabilities & KJob::Killable); | 282 | job->setKillable(capabilities & KJob::Killable); | ||
277 | 283 | | |||
278 | connect(job, &Job::updatedChanged, this, [this, job] { | 284 | connect(job, &Job::updatedChanged, this, [this, job] { | ||
279 | scheduleUpdate(job, Notifications::UpdatedRole); | 285 | scheduleUpdate(job, Notifications::UpdatedRole); | ||
280 | }); | 286 | }); | ||
281 | connect(job, &Job::summaryChanged, this, [this, job] { | 287 | connect(job, &Job::summaryChanged, this, [this, job] { | ||
▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines |