Commit e0fbab47 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Notifications] Don't bind model inside headerItem

Since Qt 5.12.5 and newer this causes infinite recursion in component creation as setting the model has ListView recreate
its header item (among other things) since

See also

Differential Revision:
parent fd01fa89
......@@ -34,6 +34,7 @@ Column {
property alias count: notificationsRepeater.count
readonly property int historyCount: historyList.count
property alias historyModel: notificationsHistoryModel
property bool showHistory: plasmoid.configuration.showHistory
......@@ -276,13 +277,6 @@ Column {
// History stuff
// The history is shown outside in a ListView
Binding {
target: historyList
property: "model"
value: notificationsHistoryModel
when: showHistory
Binding {
target: historyList
property: "delegate"
......@@ -117,7 +117,15 @@ MouseEventListener {
id: historyList
// The history stuff is quite entangled with regular notifications, so
// model and delegate are set by Bindings {} inside Notifications.qml
// we have to dive into the header item's notification loader to get it
// NOTE Previously this was done by a Binding {} in Notifications, however
// since Qt 5.12.5 changing the model causes ListView to recreate its header
// items (among other things) causing infinite recursion until it aborts
// item creation. Since the NotificationPopup {} is also created in Notifications
// this will then leave the NotificationsHelper try to access a null
// popup and crash.
model: headerItem && headerItem.notifications && headerItem.notifications.historyModel ? headerItem.notifications.historyModel : null
header: Column {
property alias jobs: jobsLoader.item
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment