GNOME Bugzilla – Bug 399982
Too many images removed from display when deleting images from under eog
Last modified: 2007-03-05 17:53:32 UTC
This bug was filed in the Debian BTS. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=370452 "Say I have a folder F which contains the images F/1.jpg F/2.jpg F/3.jpg F/4.jpg F/5.jpg Now I open the folder in eog from the command line eog F and it correctly displays the five images. However, when from the command line I do rm F/1.jpg F/2.jpg F/3.jpg it does correctly detect the deletion, however it also stop displaying a number of the still-extant images, say F/4.jpg."
I confirm this bug in version 2.16.0.1
This bug is only in trunk. eog-ng is free of it. The problem occurrs when more than one file is removed. The directory monitor gets called for each one of the removed files and in each of those calls cleanup_dead_files () is called. Then, it seems like the asynchronous nature of these calls ends up deleting files that are in the old position of the removed files. Messy. Killing cleanup_dead_files () and removing directly in the monitor callback the deleted files, one by one (as in eog-ng), could make it.
Created attachment 83923 [details] [review] fix This implements what I propossed in the previous comment. It fixes the issue by doing the *Right Thing* at the cost of some small performance, but hey, current approach is broken!
hm, the image needs to be unrefered after removing it, of course.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. Committed to trunk (rev. 3612): 2007-03-05 Claudio Saavedra <csaavedra@alumnos.utalca.cl> * libeog/eog-image-list.c: (-cleanup_dead_files), (vfs_monitor_dir_cb): Correctly handle external file removal. Fixes bug #399982.