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

[Notifications] Apply initial properties passed from `hints` map

This allows the job to show up atomically. Otherwise the popup will briefly
show up empty until the first `update` call arrives.
parent 94b71c80
......@@ -270,7 +270,7 @@ QDBusObjectPath JobsModelPrivate::requestView(const QString &appName, const QStr
QDBusObjectPath JobsModelPrivate::requestView(const QString &desktopEntry, int capabilities, const QVariantMap &hints)
{
qCDebug(NOTIFICATIONMANAGER) << "JobView requested by" << desktopEntry << "with hints" << hints;
qCDebug(NOTIFICATIONMANAGER) << "JobView requested by" << desktopEntry;
if (!m_highestJobId) {
++m_highestJobId;
......@@ -317,6 +317,9 @@ QDBusObjectPath JobsModelPrivate::requestView(const QString &desktopEntry, int c
job->setSuspendable(capabilities & KJob::Suspendable);
job->setKillable(capabilities & KJob::Killable);
// Apply initial properties
job->d->update(hints);
connect(job, &Job::updatedChanged, this, [this, job] {
scheduleUpdate(job, Notifications::UpdatedRole);
});
......
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