summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-09-01 11:46:35 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-09-01 11:46:35 +0200
commited5f55e967152ff6c7308858cb019bea2015d314 (patch)
tree217b55a4dc3e10e325c8b22f8e4408461b5e710a /src
parent910e2e3d219626be260f17bbdc0a113d04037387 (diff)
feh_reload_image: Try to reload unloadable (still existing) images ad infinitum
This commit removes the feh_file_remove_from_list call from feh_reload_image. We can safely do this because if the file itself was removed, cb_reload_timer will take care of updating the filelist, and in all other cases it is intended to leave the image in the filelist and retry. A warning will be displayed in the image if the reload failed.
Diffstat (limited to 'src')
-rw-r--r--src/slideshow.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index ba9e028..511d29c 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -149,6 +149,7 @@ void feh_reload_image(winwidget w, int resize, int force_new)
if (!w->file) {
im_weprintf(w, "couldn't reload, this image has no file associated with it.");
+ winwidget_render_image(w, 0, 0);
return;
}
@@ -166,20 +167,17 @@ void feh_reload_image(winwidget w, int resize, int force_new)
old_w = gib_imlib_image_get_width(w->im);
old_h = gib_imlib_image_get_height(w->im);
- /* force imlib2 not to cache */
- winwidget_free_image(w);
-
/* if the image has changed in dimensions - we gotta resize */
if ((feh_load_image(&tmp, FEH_FILE(w->file->data))) == 0) {
if (force_new) {
eprintf("failed to reload image\n");
} else {
im_weprintf(w, "Couldn't reload image. Is it still there?");
+ winwidget_render_image(w, 0, 0);
}
winwidget_rename(w, title);
free(title);
free(new_title);
- filelist = feh_file_remove_from_list(filelist, w->file);
return;
}
@@ -187,6 +185,9 @@ void feh_reload_image(winwidget w, int resize, int force_new)
(old_h != gib_imlib_image_get_height(tmp))))
resize = 1;
+ /* force imlib2 not to cache */
+ winwidget_free_image(w);
+
w->im = tmp;
winwidget_reset_image(w);