The refreshes are async and we were cleaning it up at the async trigger
and populating it at the end. This created an intermediate invalid state
which confused the item selection code.
This change moves all the refreshing into one reset call so the view is
only refreshed once.
This helps us keep the frontend code simpler by not having to refresh to
show momentarily invalid information.
Image takes a string and loads the relevant package at a given path
wallpapers+packageName
pluginId typically is the same as the package name on disk, but not
always, either due to bad metadata or it being deliberately mangled
during install to avoid escaped characters.
Returning the package path has the same desired effect for saving
chosen images by package names, but avoids the complexity above.
metaData presence is still queried to separate real packages from the
fake packages generated internally which represent just one image.
BUG: 423987
(cherry picked from commit 74e9f990ae)
Image takes a string and loads the relevant package at a given path
wallpapers+packageName
pluginId typically is the same as the package name on disk, but not
always, either due to bad metadata or it being deliberately mangled
during install to avoid escaped characters.
Returning the package path has the same desired effect for saving
chosen images by package names, but avoids the complexity above.
metaData presence is still queried to separate real packages from the
fake packages generated internally which represent just one image.
BUG: 423987
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...
BUG: 419234
FIXED-IN: 5.18.4
Differential Revision: https://phabricator.kde.org/D28420
Summary: According to Qt docs, QUuid() creates a null UUID object.
Test Plan: N/A, plasmashell is very unstable with Qt 5.15.
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D27237
Previously it would use an on-disk KImageCache which would never be invalidated.
Moreover, it just uses KIO::PreviewJob which does its own more clever (compares mtime and other properties) on-disk caching already.
It is using its own QCache rather than QPixmapCache to not jeopardize other caching for the potentially large wallpaper thumbnails
that are only relevant while the dialog is open.
BUG: 395447
FIXED-IN: 5.15.0
Differential Revision: https://phabricator.kde.org/D16095
They are usually hidden for a reason and shouldn't show up in the slideshow.
BUG: 394882
FIXED-IN: 5.12.6
Differential Revision: https://phabricator.kde.org/D13260
Summary:
BackgroundFinder runs in a separate thread, it uses a static QStringList cache
It's perfectly plausible that two BackgroundFinders threads could run at once
Test Plan:
Old code didn't crash, it was a pure hypothetical.
Works as before
Reviewers: #plasma, mart
Reviewed By: #plasma, mart
Subscribers: anthonyfieroni, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D11590
This allows to open the location of the folder the wallpaper is in.
BUG: 371247
FIXED-IN: 5.11.0
Differential Revision: https://phabricator.kde.org/D6450
Summary: And remove some useless debug statements as well
Test Plan: no more useless debug statment
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4529
There is no need to decode the whole image and load it into memory
when we are only interested in the dimensions.
Differential Revision: https://phabricator.kde.org/D3973
Summary:
select the correct index upon loading when the count changes.
this removes the flicker at startup and the view is at the correct
wallpaper since the first frame. Also, now when a wallpaper is
downloaded with knewstuff, the old wallpaper stays selected,
it doesn't get resetted to the first wallpaper anymore
Test Plan:
open wallpaer dialog, no more flicker
install a new wallpaper, the currently selected one stays selected
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3532
Summary:
try to preview everything that's found in the list.
by default not all image types are enabled, like
svg, which is a supported wallpaper type
Test Plan: svg files are correctly previewed in the thumbnail grid
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3017
Summary:
try to preview everything that's found in the list.
by default not all image types are enabled, like
svg, which is a supported wallpaper type
Test Plan: svg files are correctly previewed in the thumbnail grid
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3017
BackgroundFinder::suffixes(), despite its name, actually returns a list
of glob patterns. The extension of the image file is checked against
this list to ensure that it is supported, which needs to take
account of that. Do the check in a new function
BackgroundFinder::isAcceptableSuffix(const QString &suffix).
Reviewers: davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2722
Instead use QImageReader to get the glob patterns of all supported formats,
similar to what the "Open image" dialog in the regular image wallpaper did.
Also, make use of QDir::setNameFilters rather than manually filtering out non-matching files.
Differential Revision: https://phabricator.kde.org/D2511
If there are no metadata, showing "by Unknown" is a bit strange and
serves not much purpose. So let it show only the filename when no
metadata available.
REVIEW: 122622
this will allow it to be shared by other plugins out there. it does mean
sacrificing the generic "find best paper size" functionality which was
tightly bound to the image wallpaper (in plasma4, this was Plasma::Wallpaper,
so acceptable). Finding the best image is now left up to the plugin,
though I imagine that other plugins will want this eventually as well
and it will find its way into a library somewhere or else just be
copy-and-pasted a lot.
optimal solutin will be using ui scaling of Qt 5.4
use this size as optionam thumbnail size and keep thumbnails
around that size, giving more row/columnsif needed
this gives more optimal sizes and not too blurry thumbmnails
BUG:335424