diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-09-01 11:29:47 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-09-01 11:29:47 +0200 |
commit | 910e2e3d219626be260f17bbdc0a113d04037387 (patch) | |
tree | 6024bc0e413a513bc30b6de8a756971d3c4c7b6f /src/slideshow.c | |
parent | fb591037342927d25dfab887fbeff0c1671d0288 (diff) |
Revert "feh_reload_image: Always die if reload failed"
This reverts commit 8b79bc33f37db12cbb672bdb47dcfeb0f2030bce.
Diffstat (limited to 'src/slideshow.c')
-rw-r--r-- | src/slideshow.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/slideshow.c b/src/slideshow.c index 22d2124..ba9e028 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -135,12 +135,12 @@ void cb_reload_timer(void *data) winwidget_rename(w, current_filename); free(current_filename); - feh_reload_image(w, 1); + feh_reload_image(w, 1, 0); feh_add_unique_timer(cb_reload_timer, w, opt.reload); return; } -void feh_reload_image(winwidget w, int resize) +void feh_reload_image(winwidget w, int resize, int force_new) { char *title, *new_title; int len; @@ -152,7 +152,7 @@ void feh_reload_image(winwidget w, int resize) return; } - D(("resize %d\n", resize)); + D(("resize %d, force_new %d\n", resize, force_new)); free(FEH_FILE(w->file->data)->caption); FEH_FILE(w->file->data)->caption = NULL; @@ -169,10 +169,20 @@ void feh_reload_image(winwidget w, int resize) /* force imlib2 not to cache */ winwidget_free_image(w); - if ((feh_load_image(&tmp, FEH_FILE(w->file->data))) == 0) - eprintf("failed to reload image"); - /* 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_rename(w, title); + free(title); + free(new_title); + filelist = feh_file_remove_from_list(filelist, w->file); + return; + } + if (!resize && ((old_w != gib_imlib_image_get_width(tmp)) || (old_h != gib_imlib_image_get_height(tmp)))) resize = 1; |