33 :
TorcDevice(false, 0, 0, QStringLiteral(
"Notification"), Details),
39 if (Details.contains(QStringLiteral(
"outputs")) && Details.contains(QStringLiteral(
"message")))
41 QVariantMap message = Details.
value(QStringLiteral(
"message")).toMap();
42 if (message.contains(QStringLiteral(
"body")))
44 m_body = message.value(QStringLiteral(
"body")).toString();
46 if (message.contains(QStringLiteral(
"title")))
47 m_title = message.value(QStringLiteral(
"title")).toString();
49 QVariantMap outputs = Details.value(QStringLiteral(
"outputs")).toMap();
50 QVariantMap::const_iterator it = outputs.constBegin();
51 for (; it != outputs.constEnd(); ++it)
52 if (it.key() == QStringLiteral(
"notifier"))
58 LOG(VB_GENERAL, LOG_ERR, QStringLiteral(
"Notifier is incomplete"));
63 QMutexLocker locker(&
lock);
78 LOG(VB_GENERAL, LOG_ERR, QStringLiteral(
"Notification '%1' failed to find notifier '%2'").arg(
uniqueId, notifiername));
94 : nextTorcNotificationFactory(gTorcNotificationFactory)
QStringList m_notifierNames
TorcNotification(const QVariantMap &Details)
TorcNotificationFactory * nextTorcNotificationFactory
TorcNotificationFactory()
QList< TorcNotifier * > m_notifiers
TorcNotificationFactory * NextFactory(void) const
virtual void Notify(const QVariantMap &Notification)=0
#define LOG(_MASK_, _LEVEL_, _STRING_)
TorcNotifier * FindNotifierByName(const QString &Name)
static TorcNotificationFactory * gTorcNotificationFactory
void Notify(const QVariantMap &Message)
virtual bool IsKnownInput(const QString &UniqueId)
static TorcNotify * gNotify
static TorcNotificationFactory * GetTorcNotificationFactory(void)