diff --git a/interfaces/notificationsmodel.cpp b/interfaces/notificationsmodel.cpp index 80df27923..5c8c09225 100644 --- a/interfaces/notificationsmodel.cpp +++ b/interfaces/notificationsmodel.cpp @@ -62,6 +62,8 @@ QHash NotificationsModel::roleNames() const names.insert(DismissableModelRole, "dismissable"); names.insert(RepliableModelRole, "repliable"); names.insert(IconPathModelRole, "appIcon"); + names.insert(TitleModelRole, "title"); + names.insert(TextModelRole, "notitext"); return names; } @@ -198,6 +200,10 @@ QVariant NotificationsModel::data(const QModelIndex& index, int role) const return !notification->replyId().isEmpty(); case IconPathModelRole: return notification->iconPath(); + case TitleModelRole: + return notification->title(); + case TextModelRole: + return notification->text(); default: return QVariant(); } diff --git a/interfaces/notificationsmodel.h b/interfaces/notificationsmodel.h index 092356702..23ef84640 100644 --- a/interfaces/notificationsmodel.h +++ b/interfaces/notificationsmodel.h @@ -46,7 +46,9 @@ public: DismissableModelRole, RepliableModelRole, IconPathModelRole, - DbusInterfaceRole + DbusInterfaceRole, + TitleModelRole, + TextModelRole }; explicit NotificationsModel(QObject* parent = nullptr); diff --git a/plasmoid/package/contents/ui/DeviceDelegate.qml b/plasmoid/package/contents/ui/DeviceDelegate.qml index eed553f4e..b2eafa7a0 100644 --- a/plasmoid/package/contents/ui/DeviceDelegate.qml +++ b/plasmoid/package/contents/ui/DeviceDelegate.qml @@ -228,7 +228,7 @@ PlasmaComponents.ListItem anchors.left: parent.left } PlasmaComponents.Label { - text: appName + ": " + display + text: appName + ": " + (title.length>0 ? (appName==title?notitext:title+": "+notitext) : display) anchors.right: replyButton.left anchors.left: notificationIcon.right elide: listitem.checked ? Text.ElideNone : Text.ElideRight