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.
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.
As reported in https://www.reddit.com/r/kde/comments/4yqv68/webp_as_wallpaper/ and thanks for seeking the proper code snippets.
Created a test folder with a few .jpg and .webp files and some other junk as well as two sub folders with images in them.
Slideshow would pick up the .jpg and .webp images as well as the images from the subdirectories but not the other junk files.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |