! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Ristretto re-opens directories multiple times when processing multiple comman...
Status:
RESOLVED: FIXED
Product:
Ristretto
Component:
Application

Comments

Description David Baggerman 2007-11-29 07:52:53 CET
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.
Comment 1 David Baggerman 2007-11-29 07:56:52 CET
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.
Comment 2 Stephan Arts editbugs 2007-11-29 07:59:12 CET
Thanks, I'll take a look at your patch. :-)
Comment 3 David Baggerman 2007-11-29 09:06:30 CET
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. :)
Comment 4 Stephan Arts editbugs 2007-11-30 23:19:58 CET
I've tried something, could you check revision 3655, and tell me what you think?
Comment 5 David Baggerman 2007-12-01 01:57:13 CET
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.
Comment 6 Stephan Arts editbugs 2007-12-01 08:50:53 CET
Thank you, I applied the patch in revision 3656.

Bug #3701

Reported by:
David Baggerman
Reported on: 2007-11-29
Last modified on: 2009-07-14

People

Assignee:
Stephan Arts
CC List:
0 users

Version

Version:
unspecified

Attachments

Patch to fix ristretto argument processing (8.47 KB, patch)
2007-11-29 07:56 CET , David Baggerman
no flags
CLI argument processing tweaks (6.06 KB, patch)
2007-12-01 01:57 CET , David Baggerman
no flags

Additional information