Commit 3ba955f4 authored by Konrad Materka's avatar Konrad Materka
Browse files

[SystemTray] Fix model update in settings (missing icon)

Summary:
Fixes a bug, when system tray settings is opened and new application is opened, view is not correctly refreshed and icon is missing. Caused by duplicated role names. Related to: D26586

BUG: 416400
FIXED-IN: 5.18.0

Test Plan:
1. Open system tray settings
2. Open an app with systray icon
Expected:
Icon, title etc are correctly rendered.

Reviewers: #plasma_workspaces, #plasma, davidedmundson, ngraham, broulik

Reviewed By: #plasma_workspaces, #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26850
parent 82d7fd7a
......@@ -265,6 +265,14 @@ QHash<int, QByteArray> SystemTrayModel::roleNames() const
void SystemTrayModel::addSourceModel(QAbstractItemModel *sourceModel)
{
m_roleNames.unite(sourceModel->roleNames());
QHashIterator<int, QByteArray> it(sourceModel->roleNames());
while (it.hasNext()) {
it.next();
if (!m_roleNames.contains(it.key())) {
m_roleNames.insert(it.key(), it.value());
}
}
KConcatenateRowsProxyModel::addSourceModel(sourceModel);
}
Markdown is supported
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