Commit 27854ca9 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

NotifcationPopup: workaround crash in Qt when appending empty actions array

Summary:
Appending an empty array of actions to QQmlListModel triggers an assert
in Qt when built in debug mode, see https://codereview.qt-project.org/#/c/223985/
for details.

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: davidedmundson, apol, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11519
parent e37156b4
......@@ -57,8 +57,11 @@ PlasmaCore.Dialog {
//temporarly disable height binding, avoids an useless window resize when removing the old actions
heightBinding.when = false;
// notification.actions is a JS array, but we can easily append that to our model
notificationItem.actions.clear()
notificationItem.actions.append(notificationProperties.actions)
notificationItem.actions.clear();
// Workaround a crash in Qt when appending an empty list (https://codereview.qt-project.org/#/c/223985/)
if (notificationProperties.actions.length > 0) {
notificationItem.actions.append(notificationProperties.actions);
}
//enable height binding again, finally do the resize
heightBinding.when = true;
}
......
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