support for actions in WatchedNotificationsManager

* use the proper argument for actions, which is in the weird format
  name0label0,name1,label1,...
* make invokeaction, close et al invokable from QML
wilder-5.22
Marco Martin 5 years ago
parent 3a20578f08
commit 28dbdaa78e
  1. 2
      libnotificationmanager/server_p.cpp
  2. 10
      libnotificationmanager/watchednotificationsmodel.h

@ -258,7 +258,7 @@ uint ServerPrivate::Notify(const QString &app_name, uint replaces_id, const QStr
// we pass raw body data since this data goes through another sanitization
// in WatchedNotificationsModel when notification object is created.
notification.rawBody(),
notification.actionNames(),
actions,
hints,
notification.timeout()
});

@ -37,12 +37,12 @@ public:
explicit WatchedNotificationsModel();
~WatchedNotificationsModel();
void expire(uint notificationId) override;
void close(uint notificationId) override;
Q_INVOKABLE void expire(uint notificationId) override;
Q_INVOKABLE void close(uint notificationId) override;
void invokeDefaultAction(uint notificationId) override;
void invokeAction(uint notificationId, const QString &actionName) override;
void reply(uint notificationId, const QString &text) override;
Q_INVOKABLE void invokeDefaultAction(uint notificationId) override;
Q_INVOKABLE void invokeAction(uint notificationId, const QString &actionName) override;
Q_INVOKABLE void reply(uint notificationId, const QString &text) override;
bool valid();
signals:

Loading…
Cancel
Save