<table><tr><td style="">davidedmundson created this revision.<br />davidedmundson added a reviewer: Plasma.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />davidedmundson 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/D17725">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>RunnerMatchesModel is backed by a list. When this list changes<br />
RunnerManagerModel added/removed the new number of rows then called<br />
dataChanged on everything that remained.</p>

<p>It's a common pattern, but not a great one. Especially with QtQuick<br />
where moving a delegate is faster than updating all the properties of an<br />
existing one - unfortunately I can't find a nice solution to do this<br />
properly in linear time.</p>

<p>The problem with the current code is we update the entire list in the<br />
insert/remove rows. This is a violation of the model rules as we're<br />
updating rows outside the rows listed inside begin/remove rows.</p>

<p>It works, but Qt's model test fails.</p>

<p>We also have a lot of duplicates of a crash in QtQuick after runner<br />
model changes, bug 369430. I think it could be related, but can't <br />
prove anything.</p>

<p>This patch updates the rows that exist in both the before and after<br />
models before adding/removing the remaining rows.</p>

<p>BUG: 402439</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Added Qt model tester in <a href="https://phabricator.kde.org/P283" class="remarkup-link" target="_blank" rel="noreferrer">https://phabricator.kde.org/P283</a><br />
It now passes.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></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/D17725">https://phabricator.kde.org/D17725</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>applets/kicker/plugin/runnermatchesmodel.cpp</div></div></div><br /><div><strong>To: </strong>davidedmundson, Plasma<br /><strong>Cc: </strong>plasma-devel, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>