! 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 !
Wrong behaviour when starting rsitretto with a list of files to open
Status:
RESOLVED: FIXED
Product:
Ristretto
Component:
Application

Comments

Description Tim Tassonis 2008-04-23 15:13:44 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080418 Ubuntu/7.10 (gutsy) Firefox/2.0.0.14
Build Identifier: 

ristretto allows to specify a list of folders and filenames to open at startup. However, whenever a file is specified, rsitretto always opens the directory containing the file instead. So, if one file is specified, the whole folder is always opened and the funniest thing: if you specify several files in the same folder, the folder is openened once for every file.

Following patch fixes the problem:
Index: src/main.c
===================================================================
--- src/main.c  (revision 4662)
+++ src/main.c  (working copy)
@@ -475,7 +475,7 @@
                 }
                 else
                 {
-                    rstto_navigator_open_file (navigator, path_dir, TRUE, NULL);
+                    rstto_navigator_open_file (navigator, path_dir, FALSE, NULL);
                     gtk_statusbar_remove(bar, context_id, message_id);
                 }
             }


Reproducible: Always

Steps to Reproduce:
1. start ristretto with a list of files
2.
3.

Actual Results:  
The corresponding folders are opened instead of the files

Expected Results:  
The files are openened

Following patch (on r4662) fixes the problem:
Index: src/main.c
===================================================================
--- src/main.c  (revision 4662)
+++ src/main.c  (working copy)
@@ -475,7 +475,7 @@
                 }
                 else
                 {
-                    rstto_navigator_open_file (navigator, path_dir, TRUE, NULL);
+                    rstto_navigator_open_file (navigator, path_dir, FALSE, NULL);
                     gtk_statusbar_remove(bar, context_id, message_id);
                 }
             }
Comment 1 Stephan Arts editbugs 2008-04-23 20:44:15 CEST
That behaviour is not entirely undesired. It should behave like that when you open a single image, but not when you open multiple (the behaviour you described).

It is fixed in revision 4665.
Comment 2 Tim Tassonis 2008-04-23 21:24:40 CEST
(In reply to comment #1)
> That behaviour is not entirely undesired. It should behave like that when you
> open a single image, but not when you open multiple (the behaviour you
> described).
> 
> It is fixed in revision 4665.
> 
I have to say that I fail to see the logic behind this. This would make it unusable as a default image viewer for the file manager, as when I get a DVD with 90 tifs of each 50 MB in size and would click on one of them, ristretto will always read the whole 90 files first, as it did yesterday and will do with your fix. Is there a specific reason behind this, I mean the expectation is that when I call a program with one filename as a parameter, it will process exactly this one file and not the directory containing the file. With the sad exception of perhaps gqview.

May I kindly ask you to consider my version of the fix, I really think that's more consistent with expected behavior and I really can't see the value of opening the directory instead. 

Comment 3 Stephan Arts editbugs 2008-04-24 06:33:13 CEST
Personally, I don't have pictures that large. But, when I open a folder with 350+ pictures, I think I see what you mean.

I agree that it sucks for some setups, would you feel comfortable with a configuration option? 

'Load entire folder when opening a single file during startup'

This would both help you (with huge files), and don't take away this feature for other people.
Comment 4 Tim Tassonis 2008-04-24 08:46:00 CEST
(In reply to comment #3)
> Personally, I don't have pictures that large. But, when I open a folder with
> 350+ pictures, I think I see what you mean.
> 
> I agree that it sucks for some setups, would you feel comfortable with a
> configuration option? 
> 
> 'Load entire folder when opening a single file during startup'
> 
> This would both help you (with huge files), and don't take away this feature
> for other people.
> 

Yes, of course, if that's not too much work, making it configurable sounds very reasonable. Thanks a lot.
Comment 5 Stephan Arts editbugs 2008-05-06 09:20:34 CEST
Fixed in revision 4740.

Ristretto opens the file you want first, and THEN looks for other files inside that folder.
Comment 6 Tim Tassonis 2008-12-22 14:27:04 CET
Created attachment 2046 
Add option to toggle between folder open and single file open

This patch adds an option: "Load entire folder when opening a single file during startup."

This is currently the way ristretto behaves, this option lets you switch this behaviour off, so only the specified file will be opened.
Comment 7 Tim Tassonis 2008-12-22 14:28:35 CET
Added a patch to optionally support opening a single file
Comment 8 Christian Dywan 2008-12-22 18:45:09 CET
(In reply to comment #7)
> Added a patch to optionally support opening a single file

Did you consider using thumbnails instead of loading the actual images? Missing thumbnails could be loaded in the background with a generous timer. Maybe that would be better than loading no images at all.
Comment 9 Tim Tassonis 2008-12-23 10:01:46 CET
(In reply to comment #8)
> (In reply to comment #7)
> > Added a patch to optionally support opening a single file
> 
> Did you consider using thumbnails instead of loading the actual images? Missing
> thumbnails could be loaded in the background with a generous timer. Maybe that
> would be better than loading no images at all.

I think it's best to not open any other images at all. Remember, this behaviour is only relevant if you call ristretto with exactly one single image filename, like whe you use it to view in a thunar folder where you already get all thumnbnails in thunar.
Comment 10 Andrei Popescu 2009-04-18 07:24:17 CEST
Hello,

Right now (ver. 0.0.21 from Debian) I get inconsistent behavior:

- opening file from Thunar or from commandline the whole directory is opened
- using menu item File -> Open... (or Ctrl+O) exactly one file is opened and other files in directory are not accessible. Successive File -> Open... will open the previous file(s) too.

(by "open" and "accessible" I mean I can switch to the other photos using previous/next)

I can't find the option to configure the behavior (mentioned in this bug report).

May I suggest to stick with one or the other behavior and enable the alternate via an option (defaulting to open all makes more sense for me).

Regards,
Andrei
Comment 11 Stephan Arts editbugs 2009-09-28 15:14:54 CEST
Ok, an option for this has been added to master.

Bug #4035

Reported by:
Tim Tassonis
Reported on: 2008-04-23
Last modified on: 2009-09-28

People

Assignee:
Stephan Arts
CC List:
3 users

Version

Version:
unspecified

Attachments

Additional information