aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Münnich <be.muennich@googlemail.com>2012-05-13 21:52:53 +0200
committerBert Münnich <be.muennich@googlemail.com>2012-05-13 21:52:53 +0200
commitd1a1e0142b453a7083463eaf02402b4d3b31ff65 (patch)
tree72bcc1d1176e674a38ed75b869ad47ebe2508404
parent4057453d6d48fe3fa070c90449cc7308dfd84559 (diff)
Simplified & sped up reloading of all thumbnails
-rw-r--r--README.md2
-rw-r--r--commands.c24
-rw-r--r--commands.h2
-rw-r--r--config.def.h2
-rw-r--r--sxiv.12
5 files changed, 12 insertions, 20 deletions
diff --git a/README.md b/README.md
index 82a0696..b99d028 100644
--- a/README.md
+++ b/README.md
@@ -93,7 +93,7 @@ The following general key commands are available:
A Toggle visibility of alpha-channel, i.e. transparency
r Reload image
- R Refresh thumbnails
+ R Reload all thumbnails
D Remove image from file list and go to next image
diff --git a/commands.c b/commands.c
index 7567757..a27673a 100644
--- a/commands.c
+++ b/commands.c
@@ -94,22 +94,14 @@ bool it_toggle_bar(arg_t a) {
return true;
}
-bool it_refresh_thumbs(arg_t a) {
- int i = 0;
- if (mode == MODE_THUMB) {
- win_set_cursor(&win, CURSOR_WATCH);
- while (i < filecnt) {
- if (!tns_load(&tns, i, &files[i], true, false)) {
- remove_file(i, false);
- tns.dirty = true;
- if (tns.sel >= tns.cnt)
- tns.sel = tns.cnt - 1;
- } else {
- i++;
- }
- }
- }
- return true;
+bool t_reload_all(arg_t a) {
+ if (mode == MODE_THUMB) {
+ tns_free(&tns);
+ tns_init(&tns, filecnt, &win);
+ return true;
+ } else {
+ return false;
+ }
}
bool it_reload_image(arg_t a) {
diff --git a/commands.h b/commands.h
index 5cee27a..0e324c8 100644
--- a/commands.h
+++ b/commands.h
@@ -45,7 +45,7 @@ bool it_quit(arg_t);
bool it_switch_mode(arg_t);
bool it_toggle_fullscreen(arg_t);
bool it_toggle_bar(arg_t);
-bool it_refresh_thumbs(arg_t);
+bool t_reload_all(arg_t);
bool it_reload_image(arg_t);
bool it_remove_image(arg_t);
bool i_navigate(arg_t);
diff --git a/config.def.h b/config.def.h
index cb77125..1116602 100644
--- a/config.def.h
+++ b/config.def.h
@@ -64,7 +64,7 @@ static const keymap_t keys[] = {
{ false, XK_b, it_toggle_bar, (arg_t) None },
{ false, XK_r, it_reload_image, (arg_t) None },
- { false, XK_R, it_refresh_thumbs, (arg_t) None },
+ { false, XK_R, t_reload_all, (arg_t) None },
{ false, XK_D, it_remove_image, (arg_t) None },
{ false, XK_n, i_navigate, (arg_t) +1 },
diff --git a/sxiv.1 b/sxiv.1
index ca6a1fc..7701811 100644
--- a/sxiv.1
+++ b/sxiv.1
@@ -118,7 +118,7 @@ Toggle visibility of alpha-channel, i.e. image transparency.
Reload image.
.TP
.B R
-Refresh thumbnails.
+Reload all thumbnails.
.TP
.B D
Remove current image from file list and go to next image.