4
0
mirror of https://github.com/QuasarApp/SimpleQmlNotify.git synced 2025-05-04 09:19:37 +00:00

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

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

@ -127,6 +127,12 @@ public:
Q_INVOKABLE void showHistory(); 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(); ~NotificationService();
signals: signals: