]>
Commit | Line | Data |
---|---|---|
15929648 PG |
1 | --- ./src/slideshow.c.org 2011-09-02 12:55:22.245365638 +0200 |
2 | +++ ./src/slideshow.c 2011-09-02 12:55:29.089016324 +0200 | |
3 | @@ -96,6 +96,11 @@ void cb_reload_timer(void *data) | |
4 | ||
5 | /* save the current filename for refinding it in new list */ | |
6 | current_filename = estrdup(FEH_FILE(current_file->data)->filename); | |
7 | + | |
8 | + for (l = filelist; l; l = l->next) { | |
9 | + feh_file_free(l->data); | |
10 | + l->data = NULL; | |
11 | + } | |
12 | gib_list_free_and_data(filelist); | |
13 | filelist = NULL; | |
14 | filelist_len = 0; | |
15 | @@ -109,8 +114,7 @@ void cb_reload_timer(void *data) | |
16 | add_file_to_filelist_recursively(".", FILELIST_FIRST); | |
17 | ||
18 | if (!(filelist_len = gib_list_length(filelist))) { | |
19 | - fprintf(stderr, "No files found to reload.\n"); | |
20 | - exit(1); | |
21 | + eprintf("No files found to reload."); | |
22 | } | |
23 | ||
24 | /* find the previously current file */ | |
25 | @@ -149,6 +153,7 @@ void feh_reload_image(winwidget w, int r | |
26 | ||
27 | if (!w->file) { | |
28 | im_weprintf(w, "couldn't reload, this image has no file associated with it."); | |
29 | + winwidget_render_image(w, 0, 0); | |
30 | return; | |
31 | } | |
32 | ||
33 | @@ -166,20 +171,17 @@ void feh_reload_image(winwidget w, int r | |
34 | old_w = gib_imlib_image_get_width(w->im); | |
35 | old_h = gib_imlib_image_get_height(w->im); | |
36 | ||
37 | - /* force imlib2 not to cache */ | |
38 | - winwidget_free_image(w); | |
39 | - | |
40 | /* if the image has changed in dimensions - we gotta resize */ | |
41 | if ((feh_load_image(&tmp, FEH_FILE(w->file->data))) == 0) { | |
42 | if (force_new) { | |
43 | eprintf("failed to reload image\n"); | |
44 | } else { | |
45 | im_weprintf(w, "Couldn't reload image. Is it still there?"); | |
46 | + winwidget_render_image(w, 0, 0); | |
47 | } | |
48 | winwidget_rename(w, title); | |
49 | free(title); | |
50 | free(new_title); | |
51 | - filelist = feh_file_remove_from_list(filelist, w->file); | |
52 | return; | |
53 | } | |
54 | ||
55 | @@ -187,6 +189,9 @@ void feh_reload_image(winwidget w, int r | |
56 | (old_h != gib_imlib_image_get_height(tmp)))) | |
57 | resize = 1; | |
58 | ||
59 | + /* force imlib2 not to cache */ | |
60 | + winwidget_free_image(w); | |
61 | + | |
62 | w->im = tmp; | |
63 | winwidget_reset_image(w); | |
64 |