diff options
author | Bert <ber.t@gmx.com> | 2011-02-09 16:32:40 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-02-09 16:32:40 +0100 |
commit | 8e5835d1fd945ee9582aae71b3ee693b6ef46307 (patch) | |
tree | 51e0570310b1be112702976a35d9d70c36ff2cff /main.c | |
parent | 9be473443922a39e7cb52e605ccae922dde375a1 (diff) |
Handle image remove/rename while running
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -128,12 +128,17 @@ void update_title() { float size; const char *unit; - size = filesize; - size_readable(&size, &unit); + if (img.valid) { + size = filesize; + size_readable(&size, &unit); + n = snprintf(win_title, TITLE_LEN, "sxiv: [%d/%d] <%d%%> (%.2f%s) %s", + fileidx + 1, filecnt, (int) (img.zoom * 100.0), size, unit, + filenames[fileidx]); + } else { + n = snprintf(win_title, TITLE_LEN, "sxiv: [%d/%d] broken: %s", + fileidx + 1, filecnt, filenames[fileidx]); + } - n = snprintf(win_title, TITLE_LEN, "sxiv: [%d/%d] <%d%%> (%.2f%s) %s", - fileidx + 1, filecnt, (int) (img.zoom * 100.0), size, unit, - filenames[fileidx]); if (n >= TITLE_LEN) { win_title[TITLE_LEN - 2] = '.'; win_title[TITLE_LEN - 3] = '.'; @@ -350,7 +355,6 @@ void on_keypress(XKeyEvent *kev) { case XK_r: changed = load_image(); break; -; } if (changed) { |