summaryrefslogtreecommitdiff
path: root/src/thumbnail.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-01-27 23:43:24 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-01-27 23:43:24 +0100
commite04c0720e35885ecff7a540ae76620c3477471d8 (patch)
tree661e587526cde135a12af58c7435b8bdbc04b0a6 /src/thumbnail.c
parent32653a52c15431e714358198b44d8bd6699c2367 (diff)
parent5dc0d6770bc46676b969b60cc81f8ee689aaf829 (diff)
Merge branch 'ulteq-simplify-title-generation'
Diffstat (limited to 'src/thumbnail.c')
-rw-r--r--src/thumbnail.c38
1 files changed, 6 insertions, 32 deletions
diff --git a/src/thumbnail.c b/src/thumbnail.c
index edf0f4f..003c7b4 100644
--- a/src/thumbnail.c
+++ b/src/thumbnail.c
@@ -71,7 +71,6 @@ void init_thumbnail_mode(void)
gib_list *l, *last = NULL;
int lineno;
int index_image_width, index_image_height;
- char *s;
unsigned int thumb_counter = 0;
gib_list *line, *lines;
@@ -92,6 +91,9 @@ void init_thumbnail_mode(void)
td.vertical = 0;
td.max_column_w = 0;
+ if (!opt.thumb_title)
+ opt.thumb_title = "%n";
+
mode = "thumbnail";
if (opt.font)
@@ -168,15 +170,9 @@ void init_thumbnail_mode(void)
td.h + title_area_h, 0, 0, 0, 255);
}
- /* Create title now */
-
- if (!opt.title)
- s = estrdup(PACKAGE " [thumbnail mode]");
- else
- s = estrdup(feh_printf(opt.title, NULL, NULL));
-
if (opt.display) {
- winwid = winwidget_create_from_image(td.im_main, s, WIN_TYPE_THUMBNAIL);
+ winwid = winwidget_create_from_image(td.im_main, WIN_TYPE_THUMBNAIL);
+ winwidget_rename(winwid, PACKAGE " [thumbnail mode]");
winwidget_show(winwid);
}
@@ -415,8 +411,6 @@ void init_thumbnail_mode(void)
}
}
-
- free(s);
return;
}
@@ -772,24 +766,17 @@ int feh_thumbnail_get_generated(Imlib_Image * image, feh_file * file,
void feh_thumbnail_show_fullsize(feh_file *thumbfile)
{
winwidget thumbwin = NULL;
- char *s;
- if (!opt.thumb_title)
- s = thumbfile->name;
- else
- s = feh_printf(opt.thumb_title, thumbfile, NULL);
-
thumbwin = winwidget_get_first_window_of_type(WIN_TYPE_THUMBNAIL_VIEWER);
if (!thumbwin) {
thumbwin = winwidget_create_from_file(
gib_list_add_front(NULL, thumbfile),
- s, WIN_TYPE_THUMBNAIL_VIEWER);
+ WIN_TYPE_THUMBNAIL_VIEWER);
if (thumbwin)
winwidget_show(thumbwin);
} else if (FEH_FILE(thumbwin->file->data) != thumbfile) {
free(thumbwin->file);
thumbwin->file = gib_list_add_front(NULL, thumbfile);
- winwidget_rename(thumbwin, s);
feh_reload_image(thumbwin, 1, 1);
}
}
@@ -925,16 +912,3 @@ int feh_thumbnail_setup_thumbnail_dir(void)
return status;
}
-
-char *thumbnail_create_name(feh_file * file, winwidget winwid)
-{
- char *s = NULL;
-
- if (!opt.thumb_title) {
- s = estrdup(file->filename);
- } else {
- s = estrdup(feh_printf(opt.thumb_title, file, winwid));
- }
-
- return(s);
-}