<table><tr><td style="">kmaterka created this revision.<br />kmaterka added reviewers: Plasma: Workspaces, Plasma, davidedmundson, broulik, ngraham.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />kmaterka requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29386">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>In some rare situations SNI icons are not rendered. It happens randomly, only some users are affected. It does not happen on every login.<br />
Only SNI icons are not rendered, Plasmoids are fine. Restarting plasmashell or re-adding systemtray applet helps.</p>

<p>In QML all roles need to be defined before model is used. When data engines is used a a source for a data model, all roles has to be defined and proper value assigned (not a null QVariant). StatusNotifierItemSource does this properly, but in some situations it sets null QVariant for Icon. Setting empty/null QVariant removes key/role from the date set (DataConteiner implementation). If data model was loaded earlier or later when Icon has proper value it will work properly. In some rare situation it is possible that data model is loaded when Icon has null value assigned (in other words - removed), role is removed from the data model and not avaiable to system tray applet.</p>

<p>This fix makes sure that there is always a value for Icon role. To check if icon is null native method has to be used - QML does not understand that QIcon can be null.</p>

<p>BUG: 419305<br />
FIXED-IN: 5.18.5</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>I don't have any reliable method to reproduce this issue.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>BRANCH</strong><div><div>Plasma/5.18</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29386">https://phabricator.kde.org/D29386</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml<br />
applets/systemtray/systemtray.cpp<br />
applets/systemtray/systemtray.h<br />
dataengines/statusnotifieritem/statusnotifieritemsource.cpp</div></div></div><br /><div><strong>To: </strong>kmaterka, Plasma: Workspaces, Plasma, davidedmundson, broulik, ngraham<br /><strong>Cc: </strong>plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>