Krolyxon
Commit d1a1e01

Branches

Refs →

nsxivd1a1e01

Simplified & sped up reloading of all thumbnails

Author
Bert Münnich
Date
2012-05-13 21:52 +0200
Parent
4057453
Commit
d1a1e0142b453a7083463eaf02402b4d3b31ff65

+12 −20

5 files changed

  1. M README.md +1 −1
  2. M commands.c +8 −16
  3. M commands.h +1 −1
  4. M config.def.h +1 −1
  5. M sxiv.1 +1 −1
M README.md View
@@ -93,7 +93,7 @@ The following general key commands are available:
9393 A Toggle visibility of alpha-channel, i.e. transparency
9494
9595 r Reload image
96− R Refresh thumbnails
96+ R Reload all thumbnails
9797 D Remove image from file list and go to next image
9898
9999
M commands.c View
@@ -94,22 +94,14 @@ bool it_toggle_bar(arg_t a) {
9494 return true;
9595 }
9696
97−bool it_refresh_thumbs(arg_t a) {
98− int i = 0;
99− if (mode == MODE_THUMB) {
100− win_set_cursor(&win, CURSOR_WATCH);
101− while (i < filecnt) {
102− if (!tns_load(&tns, i, &files[i], true, false)) {
103− remove_file(i, false);
104− tns.dirty = true;
105− if (tns.sel >= tns.cnt)
106− tns.sel = tns.cnt - 1;
107− } else {
108− i++;
109− }
110− }
111− }
112− return true;
97+bool t_reload_all(arg_t a) {
98+ if (mode == MODE_THUMB) {
99+ tns_free(&tns);
100+ tns_init(&tns, filecnt, &win);
101+ return true;
102+ } else {
103+ return false;
104+ }
113105 }
114106
115107 bool it_reload_image(arg_t a) {
M commands.h View
@@ -45,7 +45,7 @@ bool it_quit(arg_t);
4545 bool it_switch_mode(arg_t);
4646 bool it_toggle_fullscreen(arg_t);
4747 bool it_toggle_bar(arg_t);
48−bool it_refresh_thumbs(arg_t);
48+bool t_reload_all(arg_t);
4949 bool it_reload_image(arg_t);
5050 bool it_remove_image(arg_t);
5151 bool i_navigate(arg_t);
M config.def.h View
@@ -64,7 +64,7 @@ static const keymap_t keys[] = {
6464 { false, XK_b, it_toggle_bar, (arg_t) None },
6565
6666 { false, XK_r, it_reload_image, (arg_t) None },
67− { false, XK_R, it_refresh_thumbs, (arg_t) None },
67+ { false, XK_R, t_reload_all, (arg_t) None },
6868 { false, XK_D, it_remove_image, (arg_t) None },
6969
7070 { false, XK_n, i_navigate, (arg_t) +1 },
M sxiv.1 View
@@ -118,7 +118,7 @@ Toggle visibility of alpha-channel, i.e. image transparency.
118118 Reload image.
119119 .TP
120120 .B R
121−Refresh thumbnails.
121+Reload all thumbnails.
122122 .TP
123123 .B D
124124 Remove current image from file list and go to next image.