Commit 51802b37 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Make --start-at work with filenames instead of list positions

parent 308031b6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
git HEAD

    * Fix memory leak related to the menu
    * Make --start-at work with filenames instead of list positions

Thu Apr 22 22:28:09 CEST 2010  Daniel Friesel <derf@chaosdorf.de>

* Release v1.4.3
+11 −5
Original line number Diff line number Diff line
@@ -123,10 +123,11 @@ when
.Nm
exits.  You can add files to filelists by specifying them on the commandline
when also specifying the list.
.It Cm -| , --start-at Ar position
Start at
.Ar position
in the filelist.
.It Cm -| , --start-at Ar filename
Start the filelist at
.Ar filename .
See
.Sx USAGE EXAMPLES .
.It Cm -p , --preload
Preload images.  This doesn't mean hold them in RAM, it means run through
them and eliminate unloadable images first.  Otherwise they will be removed
@@ -670,7 +671,12 @@ Show the images in .../presentation, sorted by name, in fullscreen,
automatically change to the next image after 5 seconds
.It feh -rSwidth -A Qo mv '%f' ~/images/'%n' Qc /opt/images
View all images in /opt/images and below, sorted by width, move an image to
~/image/image_name when enter is pressed.
~/image/image_name when enter is pressed
.It feh --start-at ./foo.jpg \&.
View all images in the current directory, starting with foo.jpg.  All other
images are still in the slideshow and can be viewed normally
.It feh --start-at foo.jpg *
Same as above
.El
.
.Sh BUGS
+2 −1
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ void init_parse_options(int argc, char **argv)
	opt.blur_button = 1;
	opt.no_blur_ctrl_mask = 0;

	opt.start_list_at = NULL;
	opt.no_jump_on_resort = 0;

	opt.builtin_http = 0;
@@ -627,7 +628,7 @@ static void feh_parse_option_array(int argc, char **argv)
			opt.blur_button = atoi(optarg);
			break;
		case '|':
			opt.start_list_at = atoi(optarg);
			opt.start_list_at = estrdup(optarg);
			break;
		case 't':
			opt.thumbs = 1;
+1 −1
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ struct __fehoptions {
	char *rcfile;
	char *menu_style;
	char *caption_path;
	char *start_list_at;

	gib_style *menu_style_l;

@@ -119,7 +120,6 @@ struct __fehoptions {
	int default_zoom;
	int menu_border;
	unsigned char adjust_reload;
	unsigned int start_list_at;

	unsigned char mode;
	unsigned char paused;
+12 −7
Original line number Diff line number Diff line
@@ -34,18 +34,23 @@ void init_slideshow_mode(void)
	winwidget w = NULL;
	int success = 0;
	char *s = NULL;
	gib_list *l = NULL, *last = NULL;
	gib_list *l = filelist, *last = NULL;
	feh_file *file = NULL;

	D_ENTER(3);

	mode = "slideshow";
	if (opt.start_list_at) {
		l = gib_list_nth(filelist, opt.start_list_at);
		opt.start_list_at = 0;	/* for next time */
	} else {
		l = filelist;
	for (l = filelist; l && opt.start_list_at; l = l->next) {
		if (!strcmp(opt.start_list_at, FEH_FILE(l->data)->filename)) {
			opt.start_list_at = NULL;
			break;
		}
	}

	if (opt.start_list_at)
		eprintf("--start-at %s: File not found in filelist",
				opt.start_list_at);

	mode = "slideshow";
	for (; l; l = l->next) {
		file = FEH_FILE(l->data);
		if (last) {