Remove notifications from plasmoid, if the notifications plugin gets disabled
Therefore notify the client that we're deleting all notifications. Otherwise the client wouldn't notice this and the notifications would still be available in the plasmoid. REVIEW: 127582
This commit is contained in:
parent
12ccbaef98
commit
aefa51fa86
4 changed files with 5 additions and 2 deletions
|
@ -87,6 +87,8 @@ void NotificationsModel::setDeviceId(const QString& deviceId)
|
|||
this, SLOT(notificationAdded(QString)));
|
||||
connect(m_dbusInterface, SIGNAL(notificationRemoved(QString)),
|
||||
this, SLOT(notificationRemoved(QString)));
|
||||
connect(m_dbusInterface, SIGNAL(allNotificationsRemoved()),
|
||||
this, SLOT(clearNotifications()));
|
||||
|
||||
refreshNotificationList();
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ private Q_SLOTS:
|
|||
void notificationRemoved(const QString& id);
|
||||
void refreshNotificationList();
|
||||
void receivedNotifications(QDBusPendingCallWatcher* watcher);
|
||||
void clearNotifications();
|
||||
|
||||
Q_SIGNALS:
|
||||
void deviceIdChanged(const QString& value);
|
||||
|
@ -76,8 +77,6 @@ Q_SIGNALS:
|
|||
void rowsChanged();
|
||||
|
||||
private:
|
||||
void clearNotifications();
|
||||
|
||||
DeviceNotificationsDbusInterface* m_dbusInterface;
|
||||
QList<NotificationDbusInterface*> m_notificationList;
|
||||
QString m_deviceId;
|
||||
|
|
|
@ -52,6 +52,7 @@ void NotificationsDbusInterface::clearNotifications()
|
|||
{
|
||||
qDeleteAll(mNotifications);
|
||||
mNotifications.clear();
|
||||
Q_EMIT allNotificationsRemoved();
|
||||
}
|
||||
|
||||
QStringList NotificationsDbusInterface::activeNotifications()
|
||||
|
|
|
@ -53,6 +53,7 @@ public Q_SLOTS:
|
|||
Q_SIGNALS:
|
||||
Q_SCRIPTABLE void notificationPosted(const QString& publicId);
|
||||
Q_SCRIPTABLE void notificationRemoved(const QString& publicId);
|
||||
Q_SCRIPTABLE void allNotificationsRemoved();
|
||||
|
||||
private /*methods*/:
|
||||
void removeNotification(const QString& internalId);
|
||||
|
|
Loading…
Reference in a new issue