Add new notifications at the top of the list

Summary:
This will show a list with the most recent notifications at the top, in the
plasmoid.

This is more consistent with the KDE notification plasmoid that stack them like
this too.

Reviewers: apol, #kde_connect

Reviewed By: apol, #kde_connect

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D13540
This commit is contained in:
Thomas Surrel 2018-07-12 16:16:52 +02:00 committed by Nicolas Fella
parent 48108cd316
commit 628afdeb1e

View file

@ -102,10 +102,9 @@ void NotificationsModel::setDeviceId(const QString& deviceId)
void NotificationsModel::notificationAdded(const QString& id)
{
int currentSize = m_notificationList.size();
beginInsertRows(QModelIndex(), currentSize, currentSize);
beginInsertRows(QModelIndex(), 0, 0);
NotificationDbusInterface* dbusInterface = new NotificationDbusInterface(m_deviceId, id, this);
m_notificationList.append(dbusInterface);
m_notificationList.prepend(dbusInterface);
endInsertRows();
}