Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/startuptasksmodel.cpp
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Line(s) | 93 | QObject::connect(startupInfo, &KStartupInfo::gotNewStartup, q, | |||
---|---|---|---|---|---|
94 | [this](const KStartupInfoId &id, const KStartupInfoData &data) { | 94 | [this](const KStartupInfoId &id, const KStartupInfoData &data) { | ||
95 | if (startups.contains(id)) { | 95 | if (startups.contains(id)) { | ||
96 | return; | 96 | return; | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | const QString appId = data.applicationId(); | 99 | const QString appId = data.applicationId(); | ||
100 | const QString bin = data.bin(); | 100 | const QString bin = data.bin(); | ||
101 | 101 | | |||
102 | foreach(const KStartupInfoData &known, startupData) { | 102 | for (const KStartupInfoData &known : qAsConst(startupData)) { | ||
103 | // Reject if we already have a startup notification for this app. | 103 | // Reject if we already have a startup notification for this app. | ||
104 | if (known.applicationId() == appId && known.bin() == bin) { | 104 | if (known.applicationId() == appId && known.bin() == bin) { | ||
105 | return; | 105 | return; | ||
106 | } | 106 | } | ||
107 | } | 107 | } | ||
108 | 108 | | |||
109 | const int count = startups.count(); | 109 | const int count = startups.count(); | ||
110 | q->beginInsertRows(QModelIndex(), count, count); | 110 | q->beginInsertRows(QModelIndex(), count, count); | ||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |