User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070809 Firefox/2.0.0.6 Build Identifier: When opening ristretto from command line, with multiple file or directory arguments, it will reopen the directories multiple times, and loads the same files multiple times. This can be really bad for example when using 'ristretto *.jpg' in a folder with a lot of files. Reproducible: Always Steps to Reproduce: Open ristretto from the command line, giving multiple files from the same directory, and/or the same file or folder multiple times as arguments. -or- Configure Thunar to open images with 'ristretto %F' From within Thunar, select multiple images from the same directory Open these files with ristretto Actual Results: The same files are loaded in the thumbnail viewer multiple times. Expected Results: Each directory should be loaded once, without re-opening the same files repeatedly.
Created attachment 1446 Patch to fix ristretto argument processing I had a go at changing the way ristretto processes arguments, this patch makes it avoid re-opening directories when they are given as arguments multiple times.
Thanks, I'll take a look at your patch. :-)
Oh yeah, by the way. Even with my patch, command line arguments can still have unexpected results, because when given a file, it will always load all images in the parent directory. e.g. - running e.g. 'ristretto *.jpg' will load all images in the directory, not just jpg images. - opening a non-image file will still load fine, with all the images in the same directory. After you've had a look at my patch, let me know if you're interested, and I'd be willing to have a go at making the behavior more logical. :)
I've tried something, could you check revision 3655, and tell me what you think?
Created attachment 1447 CLI argument processing tweaks Overall it's alot better - heres what I tested, and the results I got: ristretto pics/ Opens all images in the pics folder. ristretto pics/image.png Opens all images in the pics folder, and sets the navigator to images.png. ristretto pics/*.png Opens all png images, but the navigator is set to the last image instead of the first, like it is when opening folders. I've tweaked this to set the navigator to the first image when processing multiple files. ristretto file.tar.gz Where file.tar.gz is any non-image file. Doesn't check if it's an image first, and still opens all images in the parent directory. I've tweaked this to check the file is an image before loading the parent directory. ristretto *.tar.gz Doesn't load any files. ristretto pics/non.existent.file Doesn't load any files. ristretto pics/ pics/ Opens the folder twice. ristretto pics/ pics/image.png Opens all images in pics, and loads image.png a second time I'm not sure why you would use the last two, so I'm not sure what the expected behavior should be. The attached patch is to tweak the behavior I mentioned above.
Thank you, I applied the patch in revision 3656.