There was added notifications count method

This commit is contained in:
Alex 2023-04-14 19:13:49 +03:00
parent 8fe1d46df8
commit a5d21cb350
2 changed files with 11 additions and 1 deletions

View File

@ -6,7 +6,7 @@
*/
#include "notificationservice.h"
#include <QDebug>
namespace QmlNotificationService {
NotificationService::NotificationService(QObject * ptr): QObject (ptr) {
@ -116,4 +116,8 @@ void NotificationService::showHistory() {
emit sigShowHistory();
}
int NotificationService::notificationsCount() const {
return _history->rowCount({});
}
}

View File

@ -127,6 +127,12 @@ public:
Q_INVOKABLE void showHistory();
/**
* @brief notificationsCount - This method used for return count of history notifications.
* @return count of history notifications.
*/
Q_INVOKABLE int notificationsCount() const;
~NotificationService();
signals: