D26850: [SystemTray] Refresh icon in settings on update
kmaterka marked an inline comment as done. kmaterka added inline comments. INLINE COMMENTS > broulik wrote in systemtraymodel.cpp:269 > Avoid `keys()` which creates a temporary list, instead use iterators > > const auto roleNames = sourceModel->roleNames(); > for (auto it = roleNames.begin(), end = roleNames.end(); it != end; ++it) { > if (!m_roleNames.contains(it.key()) { > m_roleNames.insert(it.key(), it.value()); > } > } Done. Does it matter if I use Java-style iterator or STL-style? Documentation says that STL-style is slightly faster, but I like Java -style more. I checked plasma-workspace and both are used. REPOSITORY R120 Plasma Workspace REVISION DETAIL https://phabricator.kde.org/D26850 To: kmaterka, #plasma_workspaces, #plasma, davidedmundson, ngraham, broulik Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
D26850: [SystemTray] Refresh icon in settings on update
kmaterka updated this revision to Diff 74272. kmaterka added a comment. Iterator used REPOSITORY R120 Plasma Workspace CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D26850?vs=74164=74272 BRANCH master REVISION DETAIL https://phabricator.kde.org/D26850 AFFECTED FILES applets/systemtray/systemtraymodel.cpp To: kmaterka, #plasma_workspaces, #plasma, davidedmundson, ngraham, broulik Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
D26850: [SystemTray] Refresh icon in settings on update
broulik added inline comments. INLINE COMMENTS > systemtraymodel.cpp:269 > +QHash roleNames = sourceModel->roleNames(); > +for (const int key : roleNames.keys()) { > +if (!m_roleNames.contains(key)) { Avoid `keys()` which creates a temporary list, instead use iterators const auto roleNames = sourceModel->roleNames(); for (auto it = roleNames.begin(), end = roleNames.end(); it != end; ++it) { if (!m_roleNames.contains(it.key()) { m_roleNames.insert(it.key(), it.value()); } } REPOSITORY R120 Plasma Workspace REVISION DETAIL https://phabricator.kde.org/D26850 To: kmaterka, #plasma_workspaces, #plasma, davidedmundson, ngraham, broulik Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
D26850: [SystemTray] Refresh icon in settings on update
kmaterka added a comment. Problem was in duplicated role names, which confused ListView/delegate. REPOSITORY R120 Plasma Workspace REVISION DETAIL https://phabricator.kde.org/D26850 To: kmaterka, #plasma_workspaces, #plasma Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
D26850: [SystemTray] Refresh icon in settings on update
kmaterka created this revision. kmaterka added reviewers: Plasma: Workspaces, Plasma. kmaterka added a project: Plasma. Herald added a subscriber: plasma-devel. kmaterka requested review of this revision. REVISION SUMMARY Fixes a bug, when system tray settings is opened and new application is opened, view is not correctly refreshed and icon is missing. 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. REPOSITORY R120 Plasma Workspace BRANCH master REVISION DETAIL https://phabricator.kde.org/D26850 AFFECTED FILES applets/systemtray/systemtraymodel.cpp To: kmaterka, #plasma_workspaces, #plasma Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart