https://bugs.kde.org/show_bug.cgi?id=419234

Kai Uwe Broulik <k...@privat.broulik.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Latest Commit|                            |https://commits.kde.org/pla
                   |                            |sma-workspace/492301406a465
                   |                            |6fbc6c9a1be0e77e68c5535bf93
   Version Fixed In|                            |5.18.4
             Status|CONFIRMED                   |RESOLVED

--- Comment #8 from Kai Uwe Broulik <k...@privat.broulik.de> ---
Git commit 492301406a4656fbc6c9a1be0e77e68c5535bf93 by Kai Uwe Broulik.
Committed on 31/03/2020 at 11:35.
Pushed by broulik into branch 'Plasma/5.18'.

[Image Wallpaper] Fix thumbnail generation when model is reloaded in-flight

GHNS Quick Button signals changedEntriesChanged initially even if nothing
changed.
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.

It looks up whether a preview exists by QUrl and stores a
QPersistentModelIndex.
However, when the model is reloaded and it accesses data for the same QUrl, the
job might still be in-flight,
but the QPersistentModelIndex is invalid as the model has been reset.

This fixes it by performing all lookups exclusively on QPersistentModelIndex.
The hash lookup is optimized for data() (loads of accesses) with the slower
key() lookup being done only
when the less frequently occurring thumbnail generation finishes/fails.
It will now do two preview jobs initially, but at least it shows something
again...
FIXED-IN: 5.18.4

Differential Revision: https://phabricator.kde.org/D28420

M  +8    -8    wallpapers/image/backgroundlistmodel.cpp
M  +1    -1    wallpapers/image/backgroundlistmodel.h

https://commits.kde.org/plasma-workspace/492301406a4656fbc6c9a1be0e77e68c5535bf93

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to