<table><tr><td style="">hein updated this revision to Diff 9744.<br />hein added a comment.
</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/D3950" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Eliminate reliance on QueuedConnection.</p>
<p>In the previous version of the patch we still relied on QueuedConnection<br />
for the dataChanged invocation, because we were connecting to our own<br />
rowsRemoved. Proxy models emit rowsRemoved in response to their source<br />
model emitting aboutToBeRemoved (a row has to be removed from a proxy<br />
before it is removed from the source, otherwise things dangle). The<br />
dataChanged causes filterAcceptsRow to run, which checks the filterProxyModel<br />
for window/startup rows. With a direct connection it would still have the<br />
window, since it's just in "about to remove" stage, necessitating the<br />
QueuedConnection.</p>
<p>Queueing things is Bad because it's hard to be sure what happens while the<br />
event loop spins. In this version of the patch we collect the indices in<br />
the source model's aboutToBeRemoved as previously, but then invoke<br />
dataChanged as the filterProxyModel (the one filterAcceptsRow checks) emits<br />
rowsRemoved. Now we can be sure filterAcceptsRow won't find the window in<br />
the filterProxyModel and will let the 'changed' launcher through, completing<br />
the lifecycle transition.</p>
<p>This guarantees things happen synchronously without an event loop spin<br />
inbetween, which should also take care of the activity thing.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D3950?vs=9692&id=9744" rel="noreferrer">https://phabricator.kde.org/D3950?vs=9692&id=9744</a></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3950" rel="noreferrer">https://phabricator.kde.org/D3950</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>libtaskmanager/tasksmodel.cpp</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>hein, davidedmundson, mart<br /><strong>Cc: </strong>plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas<br /></div>