Changeset View
Changeset View
Standalone View
Standalone View
plugins/sendnotifications/notificationslistener.cpp
Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Line(s) | 231 | if (!body.isEmpty() && m_plugin->config()->get(QStringLiteral("generalIncludeBody"), true)) | |||
---|---|---|---|---|---|
232 | ticker += QStringLiteral(": ") + body; | 232 | ticker += QStringLiteral(": ") + body; | ||
233 | 233 | | |||
234 | if (app.blacklistExpression.isValid() && | 234 | if (app.blacklistExpression.isValid() && | ||
235 | !app.blacklistExpression.pattern().isEmpty() && | 235 | !app.blacklistExpression.pattern().isEmpty() && | ||
236 | app.blacklistExpression.match(ticker).hasMatch()) | 236 | app.blacklistExpression.match(ticker).hasMatch()) | ||
237 | return 0; | 237 | return 0; | ||
238 | 238 | | |||
239 | //qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Sending notification from" << appName << ":" <<ticker << "; appIcon=" << appIcon; | 239 | //qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Sending notification from" << appName << ":" <<ticker << "; appIcon=" << appIcon; | ||
240 | NetworkPackage np(PACKAGE_TYPE_NOTIFICATION, { | 240 | NetworkPacket np(PACKET_TYPE_NOTIFICATION, { | ||
241 | {"id", QString::number(replacesId > 0 ? replacesId : ++id)}, | 241 | {"id", QString::number(replacesId > 0 ? replacesId : ++id)}, | ||
242 | {"appName", appName}, | 242 | {"appName", appName}, | ||
243 | {"ticker", ticker}, | 243 | {"ticker", ticker}, | ||
244 | {"isClearable", timeout == 0} | 244 | {"isClearable", timeout == 0} | ||
245 | }); // KNotifications are persistent if | 245 | }); // KNotifications are persistent if | ||
246 | // timeout == 0, for other notifications | 246 | // timeout == 0, for other notifications | ||
247 | // clearability is pointless | 247 | // clearability is pointless | ||
248 | 248 | | |||
Show All 14 Lines | 262 | else if (!appIcon.isEmpty()) | |||
263 | iconSource = iconForIconName(appIcon); | 263 | iconSource = iconForIconName(appIcon); | ||
264 | else if (hints.contains(QStringLiteral("icon_data"))) // < 1.1 backward compatibility | 264 | else if (hints.contains(QStringLiteral("icon_data"))) // < 1.1 backward compatibility | ||
265 | iconSource = iconForImageData(hints[QStringLiteral("icon_data")]); | 265 | iconSource = iconForImageData(hints[QStringLiteral("icon_data")]); | ||
266 | 266 | | |||
267 | if (iconSource) | 267 | if (iconSource) | ||
268 | np.setPayload(iconSource, iconSource->size()); | 268 | np.setPayload(iconSource, iconSource->size()); | ||
269 | } | 269 | } | ||
270 | 270 | | |||
271 | m_plugin->sendPackage(np); | 271 | m_plugin->sendPacket(np); | ||
272 | 272 | | |||
273 | return (replacesId > 0 ? replacesId : id); | 273 | return (replacesId > 0 ? replacesId : id); | ||
274 | } | 274 | } |