<table><tr><td style="">broulik created this revision.<br />broulik added reviewers: Plasma, leinir, davidre.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />broulik 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/D28420">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>GHNS Quick Button signals <tt style="background: #ebebeb; font-size: 13px;">changedEntriesChanged</tt> initially even if nothing changed.<br />
While this is a bug that should be fixed in GHNS, the wallpaper model didn't handle the case well, when the model was reloaded while a preview was being generated.</p>
<p>It looks up whether a preview exists by <tt style="background: #ebebeb; font-size: 13px;">QUrl</tt> and stores a <tt style="background: #ebebeb; font-size: 13px;">QPersistentModelIndex</tt>. However, when the model is reloaded and it accesses <tt style="background: #ebebeb; font-size: 13px;">data</tt> for the same <tt style="background: #ebebeb; font-size: 13px;">QUrl</tt>, the job might still be in-flight, but the <tt style="background: #ebebeb; font-size: 13px;">QPersistentModelIndex</tt> is invalid as the model has been reset.</p>
<p>This fixes it by performing all lookups exclusively on <tt style="background: #ebebeb; font-size: 13px;">QPersistentModelIndex</tt>. The hash lookup is optimized for <tt style="background: #ebebeb; font-size: 13px;">data()</tt> (loads of accesses) with the slower <tt style="background: #ebebeb; font-size: 13px;">key()</tt> lookup being done only when the less frequently occurring thumbnail generation finishes/fails.<br />
It will now do two preview jobs initially, but at least it shows something again...</p>
<p>BUG: 419234<br />
FIXED-IN: 5.18.4</p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">I get thumbnails in wallpaper dialog again</li>
<li class="remarkup-list-item">It doesn't spwan multiple preview jobs for the same index anymore.</li>
</ul></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/D28420">https://phabricator.kde.org/D28420</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>wallpapers/image/backgroundlistmodel.cpp<br />
wallpapers/image/backgroundlistmodel.h</div></div></div><br /><div><strong>To: </strong>broulik, Plasma, leinir, davidre<br /><strong>Cc: </strong>plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>