Changeset View
Changeset View
Standalone View
Standalone View
dataengines/notifications/notificationsengine.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 200 | foreach(NotificationInhibiton *ni, m_inhibitions) { | |||
---|---|---|---|---|---|
204 | } | 204 | } | ||
205 | } | 205 | } | ||
206 | 206 | | |||
207 | uint partOf = 0; | 207 | uint partOf = 0; | ||
208 | const QString appRealName = hints[QStringLiteral("x-kde-appname")].toString(); | 208 | const QString appRealName = hints[QStringLiteral("x-kde-appname")].toString(); | ||
209 | const QString eventId = hints[QStringLiteral("x-kde-eventId")].toString(); | 209 | const QString eventId = hints[QStringLiteral("x-kde-eventId")].toString(); | ||
210 | const bool skipGrouping = hints[QStringLiteral("x-kde-skipGrouping")].toBool(); | 210 | const bool skipGrouping = hints[QStringLiteral("x-kde-skipGrouping")].toBool(); | ||
211 | const QStringList &urls = hints[QStringLiteral("x-kde-urls")].toStringList(); | 211 | const QStringList &urls = hints[QStringLiteral("x-kde-urls")].toStringList(); | ||
212 | const QString &desktopEntry = hints[QStringLiteral("desktop-entry")].toString(); | ||||
212 | 213 | | |||
213 | // group notifications that have the same title coming from the same app | 214 | // group notifications that have the same title coming from the same app | ||
214 | // or if they are on the "blacklist", honor the skipGrouping hint sent | 215 | // or if they are on the "blacklist", honor the skipGrouping hint sent | ||
215 | if (!replaces_id && m_activeNotifications.values().contains(app_name + summary) && !skipGrouping && !m_alwaysReplaceAppsList.contains(app_name)) { | 216 | if (!replaces_id && m_activeNotifications.values().contains(app_name + summary) && !skipGrouping && !m_alwaysReplaceAppsList.contains(app_name)) { | ||
216 | // cut off the "notification " from the source name | 217 | // cut off the "notification " from the source name | ||
217 | partOf = m_activeNotifications.key(app_name + summary).midRef(13).toUInt(); | 218 | partOf = m_activeNotifications.key(app_name + summary).midRef(13).toUInt(); | ||
218 | } | 219 | } | ||
219 | 220 | | |||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | |||||
309 | notificationData.insert(QStringLiteral("appName"), appname_str); | 310 | notificationData.insert(QStringLiteral("appName"), appname_str); | ||
310 | notificationData.insert(QStringLiteral("appIcon"), app_icon); | 311 | notificationData.insert(QStringLiteral("appIcon"), app_icon); | ||
311 | notificationData.insert(QStringLiteral("summary"), summaryFinal); | 312 | notificationData.insert(QStringLiteral("summary"), summaryFinal); | ||
312 | notificationData.insert(QStringLiteral("body"), bodyFinal); | 313 | notificationData.insert(QStringLiteral("body"), bodyFinal); | ||
313 | notificationData.insert(QStringLiteral("actions"), actions); | 314 | notificationData.insert(QStringLiteral("actions"), actions); | ||
314 | notificationData.insert(QStringLiteral("isPersistent"), isPersistent); | 315 | notificationData.insert(QStringLiteral("isPersistent"), isPersistent); | ||
315 | notificationData.insert(QStringLiteral("expireTimeout"), timeout); | 316 | notificationData.insert(QStringLiteral("expireTimeout"), timeout); | ||
316 | 317 | | |||
318 | notificationData.insert(QStringLiteral("desktopEntry"), desktopEntry); | ||||
319 | | ||||
320 | KService::Ptr service = KService::serviceByStorageId(desktopEntry); | ||||
321 | if (service) { | ||||
322 | notificationData.insert(QStringLiteral("appServiceName"), service->name()); | ||||
323 | notificationData.insert(QStringLiteral("appServiceIcon"), service->icon()); | ||||
324 | } | ||||
325 | | ||||
317 | bool configurable = false; | 326 | bool configurable = false; | ||
318 | if (!appRealName.isEmpty()) { | 327 | if (!appRealName.isEmpty()) { | ||
319 | 328 | | |||
320 | if (m_configurableApplications.contains(appRealName)) { | 329 | if (m_configurableApplications.contains(appRealName)) { | ||
321 | configurable = m_configurableApplications.value(appRealName); | 330 | configurable = m_configurableApplications.value(appRealName); | ||
322 | } else { | 331 | } else { | ||
323 | // Check whether the application actually has notifications we can configure | 332 | // Check whether the application actually has notifications we can configure | ||
324 | KConfig config(appRealName + QStringLiteral(".notifyrc"), KConfig::NoGlobals); | 333 | KConfig config(appRealName + QStringLiteral(".notifyrc"), KConfig::NoGlobals); | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |