do not try to reload deleted image
authorVladimir Nadvornik <[email protected]>
Fri, 24 Jul 2009 12:56:54 +0000 (12:56 +0000)
committerVladimir Nadvornik <[email protected]>
Fri, 24 Jul 2009 12:56:54 +0000 (12:56 +0000)
deleted image is replaced by the next one from the list, keep
the old image displayed until the new one is set

src/image.c
src/layout_image.c

index 6c6fad21eef07376ac18681f8c806d38e0bdc942..9ca3b37b14927d40e84ef80dd220d1542a96bd30 100644 (file)
@@ -1442,6 +1442,8 @@ static void image_notify_cb(FileData *fd, NotifyType type, gpointer data)
 
        if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE)) && fd == imd->image_fd)
                {
+               if ((type & NOTIFY_CHANGE) && fd->change && fd->change->type == FILEDATA_CHANGE_DELETE)
+                       return; /* keep the image displayed, it will be replaced by the next image from the list soon */
                DEBUG_1("Notify image: %s %04x", fd->path, type);
                image_reload(imd);
                }
index 69081e1c93ab4c406afcb4c734338ff10a050942..c9752cadeac2e5d72dc1072a42618abbc4351158 100644 (file)
@@ -1879,9 +1879,11 @@ static void layout_image_maint_removed(LayoutWindow *lw, FileData *fd)
                                layout_image_set_collection(lw, cd, new);
                                return;
                                }
+                       layout_image_set_fd(lw, NULL);
                        }
-
-               layout_image_set_fd(lw, NULL);
+                       
+               /* the image will be set to the next image from the list soon,  
+                  setting it to NULL here is not necessary*/
                }
 }