增加了一个转发应用未读消息数量消息的接口

This commit is contained in:
iaom 2023-03-20 18:08:44 +08:00
parent 37c02a90a1
commit 82ba790de2
3 changed files with 15 additions and 0 deletions

View File

@ -11,5 +11,13 @@
<arg name="id" type="u" direction="in"/>
<arg name="action_key" type="s" direction="in"/>
</method>
<method name="UpdateUnreadMessagesNumber">
<arg name="desktop_entry" type="s" direction="in"/>
<arg name="number" type="u" direction="in"/>
</method>
<signal name="UnreadMessageNumberUpdated">
<arg name="desktop_entry" type="s" direction="out"/>
<arg name="number" type="u" direction="out"/>
</signal>
</interface>
</node>

View File

@ -52,10 +52,12 @@ public:
*/
void CloseNotification(uint id, uint);
void InvokeAction(uint id, const QString &action_key);
void UpdateUnreadMessagesNumber(const QString &desktopEntry, uint number);
Q_SIGNALS:
void NotificationClosed(uint id, uint reason);
void ActionInvoked(uint id, const QString &actionKey);
void ActivationToken(uint id, const QString &ActivationToken);
void UnreadMessageNumberUpdated(const QString &desktopEntry, uint number);
public:
explicit ServerPrivate(QObject *parent = nullptr);
~ServerPrivate() override;

View File

@ -174,6 +174,11 @@ void ServerPrivate::sendCache()
}
}
void ServerPrivate::UpdateUnreadMessagesNumber(const QString &desktopEntry, uint number)
{
Q_EMIT UnreadMessageNumberUpdated(desktopEntry, number);
}
Server::Server(QObject *parent): QObject(parent), d(new ServerPrivate(this))
{
}