From 08824c8e610526b38b00c3b51d1e3f7bd9b115f1 Mon Sep 17 00:00:00 2001 From: "a.yankovich" <EndrIIMail@gmail.com> Date: Wed, 20 Nov 2019 17:54:52 +0300 Subject: [PATCH] fix show notify --- NotifyModule/NotificationServiceView.qml | 5 ++++- notificationdata.cpp | 4 ++++ notificationdata.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NotifyModule/NotificationServiceView.qml b/NotifyModule/NotificationServiceView.qml index 4e3420f..4c5baa3 100644 --- a/NotifyModule/NotificationServiceView.qml +++ b/NotifyModule/NotificationServiceView.qml @@ -28,6 +28,9 @@ Item { } onMsgChanged: { - notyfyView._show(); + + if (msg.isValid()) { + notyfyView._show(); + } } } diff --git a/notificationdata.cpp b/notificationdata.cpp index b9aeb01..3825b2a 100644 --- a/notificationdata.cpp +++ b/notificationdata.cpp @@ -37,4 +37,8 @@ bool NotificationData::operator !=(const NotificationData &righ) { int NotificationData::type() const { return _type; } + +bool NotificationData::isValid() const { + return _text.size() || _title.size() || _img.size(); +} } diff --git a/notificationdata.h b/notificationdata.h index 32797d6..c7e1d91 100644 --- a/notificationdata.h +++ b/notificationdata.h @@ -37,6 +37,7 @@ public: Q_INVOKABLE QString img() const; Q_INVOKABLE QString title() const; Q_INVOKABLE int type() const; + Q_INVOKABLE bool isValid() const; bool operator ==(const NotificationData &righ); bool operator !=(const NotificationData &righ);