<table><tr><td style="">bruns requested changes to this revision.<br />bruns added a comment.<br />This revision now requires changes to proceed.
</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/D19796">View Revision</a></tr></table><br /><div><div><p>This is just much to complicated, adding layer over layer does not help.</p>

<p>Also, the second problem is unrelated to the change you mention - the "hasMessage" property could only be true for one DeviceItem, before and after.</p></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19796#inline-120310">View Inline</a><span style="color: #4b4d51; font-weight: bold;">DeviceItem.qml:50</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span style="color: #004012">readonly</span> <span style="color: #004012">property</span> <span style="color: #004012">bool</span> <span style="color: #aa4000">hasMessage:</span> <span style="color: #004012">statusSource</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span style="color: #004012"><span class="bright">lastUdi</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">==</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">udi</span></span> <span style="color: #aa2211">&&</span> <span style="color: #004012">statusSource</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span style="color: #004012"><span class="bright">data</span></span><span class="bright"></span><span class="p"><span class="bright">[</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">statusSource</span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span style="color: #004012">last<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">]</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">?</span></span><span class="bright"> </span><span style="color: #aa4000"><span class="bright">true :</span></span><span class="bright"> </span><span style="color: #000a65"><span class="bright">false</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">    <span style="color: #004012">readonly</span> <span style="color: #004012">property</span> <span style="color: #aa4000">var</span> <span style="color: #aa4000">message:</span> <span style="color: #004012">hasMessage</span> <span style="color: #aa2211">?</span> <span style="color: #004012">statusSource</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span style="color: #004012"><span class="bright">data</span></span><span class="bright"></span><span class="p"><span class="bright">[</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">statusSource</span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">last</span></span><span class="bright"></span><span class="p"><span class="bright">]</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">||</span></span><span class="bright"> </span><span class="p"><span class="bright">({})</span></span> <span style="color: #aa2211">:</span> <span class="p">({})</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #004012">readonly</span> <span style="color: #004012">property</span> <span style="color: #004012">bool</span> <span style="color: #aa4000">hasMessage:</span> <span style="color: #004012">statusSource</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span style="color: #004012"><span class="bright">trigger</span></span> <span style="color: #aa2211">&&</span> <span style="color: #004012">statusSource</span><span class="p">.</span><span style="color: #004012">last<span class="bright">Messages</span></span><span class="bright"></span><span class="p"><span class="bright">[</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">udi</span></span><span class="bright"></span><span class="p"><span class="bright">]</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">    <span style="color: #004012">readonly</span> <span style="color: #004012">property</span> <span style="color: #aa4000">var</span> <span style="color: #aa4000">message:</span> <span style="color: #004012">hasMessage</span> <span style="color: #aa2211">?</span> <span style="color: #004012">statusSource</span><span class="p">.<span class="bright"></span></span><span class="bright"></span><span style="color: #004012"><span class="bright">lastMessages</span></span><span class="bright"></span><span class="p"><span class="bright">[</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">udi</span></span><span class="bright"></span><span class="p"><span class="bright">]</span></span> <span style="color: #aa2211">:</span> <span class="p">({})</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">trigger is essentially always true</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19796#inline-120315">View Inline</a><span style="color: #4b4d51; font-weight: bold;">DeviceItem.qml:125</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #74777d">// otherwise the last message will show again when this device reappears</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">            <span style="color: #004012">statusSource</span><span class="p">.</span><span style="color: #004012">clearMessage</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: #004012">statusSource</span><span class="p">.</span><span style="color: #004012">clearMessage</span><span class="p">(<span class="bright"></span></span><span class="bright"></span><span style="color: #004012"><span class="bright">udi</span></span><span class="p">)</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">the item should not mess with the internals of the statusSource</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19796#inline-120314">View Inline</a><span style="color: #4b4d51; font-weight: bold;">FullRepresentation.qml:108</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #aa2211">!</span><span style="color: #004012">plasmoid</span><span class="p">.</span><span style="color: #004012">expanded</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">                <span style="color: #004012">statusSource</span><span class="p">.</span><span style="color: #004012">clearMessage</span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #004012">statusSource</span><span class="p">.</span><span style="color: #004012">clearMessage<span class="bright">s</span></span><span class="p">()</span>
</div><div style="padding: 0 8px; margin: 0 4px; ">            <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This is IMHO wrong, if the plasmoid shows an error message and I happen to close it by clicking elsewhere, I can no longer see the error message, although it still applies</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19796#inline-120180">View Inline</a><span style="color: #4b4d51; font-weight: bold;">FullRepresentation.qml:181</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; ">            <span style="color: #aa4000">state:</span> <span style="color: #004012">sdSource</span><span class="p">.</span><span style="color: #004012">data</span><span class="p">[</span><span style="color: #004012">udi</span><span class="p">]</span> <span style="color: #aa2211">?</span> <span style="color: #004012">sdSource</span><span class="p">.</span><span style="color: #004012">data</span><span class="p">[</span><span style="color: #004012">udi</span><span class="p">].</span><span style="color: #aa4000">State :</span> <span style="color: #601200">0</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">            <span style="color: #aa4000">isRoot:</span> <span style="color: #004012">sdSource</span><span class="p">.</span><span style="color: #004012">data</span><span class="p">[</span><span style="color: #004012">udi</span><span class="p">][</span><span style="color: #766510">"File Path"</span><span class="p">]</span> <span style="color: #aa2211">===</span> <span style="color: #766510">"/"</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: #aa4000">isRoot:</span> <span style="color: #004012">sdSource</span><span class="p">.</span><span style="color: #004012">data</span><span class="p">[</span><span style="color: #004012">udi</span><span class="p">]<span class="bright"></span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">?</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">sdSource</span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">data</span></span><span class="bright"></span><span class="p"><span class="bright">[</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">udi</span></span><span class="bright"></span><span class="p"><span class="bright">]</span>[</span><span style="color: #766510">"File Path"</span><span class="p">]</span> <span style="color: #aa2211">===</span> <span style="color: #766510">"/"<span class="bright"></span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">:</span></span><span class="bright"> </span><span style="color: #000a65"><span class="bright">false</span></span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This is an unrelated change, and fixes an error introduced in <a href="https://phabricator.kde.org/R120:d1a5507bd57aa74c18392354dcd43b65e15ee491" class="remarkup-link" target="_blank" rel="noreferrer">https://phabricator.kde.org/R120:d1a5507bd57aa74c18392354dcd43b65e15ee491</a></p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D19796#inline-120308">View Inline</a><span style="color: #4b4d51; font-weight: bold;">devicenotifier.qml:218</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(251, 175, 175, .7);">                <span class="bright"></span><span style="color: #aa4000"><span class="bright">if</span></span><span class="bright"> </span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">sdS</span>ource<span class="bright"></span></span><span class="bright"></span><span class="p"><span class="bright">.</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">isViableDevice</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">lastUdi</span></span><span class="bright"></span><span class="p"><span class="bright">))</span></span><span class="bright"> </span><span class="p"><span class="bright">{</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"><span class="bright">                </span><span style="color: #74777d"><span class="bright">// Source is formatted as follows: "<udi> notification"</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="bright"></span><span style="color: #aa4000"><span class="bright">var</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">udi</span></span><span class="bright"> </span><span style="color: #aa2211"><span class="bright">=</span></span><span class="bright"> </span><span style="color: #004012"><span class="bright">s</span>ource<span class="bright">s</span></span><span class="bright"></span><span class="p"><span class="bright">[</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">i</span></span><span class="bright"></span><span class="p"><span class="bright">].</span></span><span class="bright"></span><span style="color: #004012"><span class="bright">split</span></span><span class="bright"></span><span class="p"><span class="bright">(</span></span><span class="bright"></span><span style="color: #766510"><span class="bright">' '</span></span><span class="bright"></span><span class="p"><span class="bright">)[</span></span><span class="bright"></span><span style="color: #601200"><span class="bright">0</span></span><span class="bright"></span><span class="p"><span class="bright">]</span></span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #004012">data</span><span class="p">[</span><span style="color: #004012">sources</span><span class="p">[</span><span style="color: #004012">i</span><span class="p">]].</span><span style="color: #004012">error</span><span class="p">.</span><span style="color: #004012">length</span> <span style="color: #aa2211">></span> <span style="color: #601200">0</span><span class="p">)</span> <span class="p">{</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">would be much simpler to use <tt style="background: #ebebeb; font-size: 13px;">udi = data[sources[i]].udi</tt></p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19796">https://phabricator.kde.org/D19796</a></div></div><br /><div><strong>To: </strong>thsurrel, Plasma, broulik, bruns<br /><strong>Cc: </strong>anthonyfieroni, plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>