Bug 235710 - Plasma Wallpaper Slideshow to periodially recheck contents of image folder.
Summary: Plasma Wallpaper Slideshow to periodially recheck contents of image folder.
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: wallpaper-image (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Paolo Capriotti
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 13:24 UTC by Tristan
Modified: 2013-01-22 01:25 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11


Attachments
Patch correcting the bug (8.85 KB, patch)
2012-12-19 21:47 UTC, Erwan MATHIEU
Details
Patch to be applied after the previous one (forgotten changes) (2.57 KB, patch)
2012-12-19 21:53 UTC, Erwan MATHIEU
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan 2010-04-29 13:24:57 UTC
Version:           Plasma Workspace: 0.3 (using KDE 4.4.2)
OS:                Linux
Installed from:    Ubuntu Packages

The wallpaper slideshow can not handle changes to the contents of the image folder.  If you add images to the folder they do not get picked up for display and if you replace all the current images it stops changing.

I wanted to have The photos of the day from WSJ cycle on my desktop.  I have a cron script that downloads the photos of the day into the selected image folder and removes the yesterdays photos.  This causes the slideshow to stop. As a workaround I  go into the desktop settings and press OK to re-scan the image folder.  

It would be great if the desktop could dynamically handle changes to this folder by checking it periodically.  Every 1-4 hours would be fine for my needs, though being configurable may be useful for some.

Note: Any hints on what I could add to my script to get it to work would be greatly appreciated and if anyone want my script just ask.

Cheers
Tristan
Comment 1 Karl-Johan Karlsson 2012-05-27 14:18:54 UTC
*** This bug has been confirmed by popular vote. ***
Comment 2 Erwan MATHIEU 2012-11-28 21:00:40 UTC
I have an other problem which could be solved the same way : my images folder is a NFS folder stored on a NAS. When the desktop is loaded, the folder is scanned, but it is empty, as the network is not ready yet. The slideshow then stops and nothing is ever displayed. Within some seconds, the network gets ready, the folder is full of images, but the slideshow has already stopped.

In this case, scanning every 1 hour is not good, because that means I have to wait 1 hour before the first image is displayed. Scanning more often would not be better, as it would overload the drive.

Maybe we can use a QFileSystemWatcher to trigger the scan (or any similar KDE class). I can implement it and provide a patch, if someone tells me this behavior is correct.
Comment 3 Tristan 2012-11-29 06:20:54 UTC
This behaviour seems the way to go with the directoryChanged() function monitoring the destination folders.

If you can patch it, I would still be interested in using it.
Comment 4 Erwan MATHIEU 2012-12-19 21:47:04 UTC
Created attachment 75932 [details]
Patch correcting the bug

This patch corrects the bug by using the KDirWatch instance to watch all the subdirectories of the selected directories.
Comment 5 Erwan MATHIEU 2012-12-19 21:53:43 UTC
Created attachment 75933 [details]
Patch to be applied after the previous one (forgotten changes)

This patch is to be applied after the previous one to correct the bug (I had forgotten to commit some changes)
Comment 6 Jekyll Wu 2012-12-20 09:01:30 UTC
(In reply to comment #5)
> Created attachment 75933 [details]
> Patch to be applied after the previous one (forgotten changes)
> 
> This patch is to be applied after the previous one to correct the bug (I had
> forgotten to commit some changes)

@Erwan MATHIEU, the recommended way of submitting patches is using reviewboard.kde.org . Patches attached in bug tracker are easy to be forgotten since there are always too many reports in the bug tracker.
Comment 7 Erwan MATHIEU 2012-12-20 10:58:29 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Created attachment 75933 [details]
> > Patch to be applied after the previous one (forgotten changes)
> > 
> > This patch is to be applied after the previous one to correct the bug (I had
> > forgotten to commit some changes)
> 
> @Erwan MATHIEU, the recommended way of submitting patches is using
> reviewboard.kde.org . Patches attached in bug tracker are easy to be
> forgotten since there are always too many reports in the bug tracker.

Thank you, I could not find this information on the Wiki, and I read somewhere that sending the patch on the bug report was the best way... I will forward it as soon as possible.
Comment 8 Jeremy Whiting 2013-01-08 19:38:10 UTC
Git commit baebc4e203da5d0457fdf68b50ee3b01a8b9f881 by Jeremy Whiting.
Committed on 08/01/2013 at 20:32.
Pushed by whiting into branch 'master'.

Rescan slideshow image folders when they change.
Patch by Erwan MATHIEU <wawanbreton@gmail.com>
REVIEW: 107821

M  +13   -3    plasma/generic/wallpapers/image/backgroundlistmodel.cpp
M  +4    -0    plasma/generic/wallpapers/image/backgroundlistmodel.h
M  +77   -31   plasma/generic/wallpapers/image/image.cpp
M  +6    -3    plasma/generic/wallpapers/image/image.h

http://commits.kde.org/kde-workspace/baebc4e203da5d0457fdf68b50ee3b01a8b9f881