Bug 362274

Summary: Local files treated as URLs when more than one is placed on command line
Product: [Applications] gwenview Reporter: Brendon Higgins <brendon>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: myriam, nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Brendon Higgins 2016-04-26 01:47:29 UTC
If more than one local image filename is given on the command line when starting Gwenview, Gwenview generates a .desktop file for each of them in a folder in /tmp attempting to link to the files' names but with "http://" prepended. It seem to be attempting to interpret the filenames as http URLs. Gwenview opens in browse mode inside the tmp folder, but fails to display any images.

This bug is closely related to bug #340418 (I was tempted to leave a comment there, but given that bug's age and the fact that it does mention only loading one local file, I decided to file a new bug). That bug was fixed, but if you look at the diff and the surrounding code, you quickly see that the case where multiple files are given on the command line is a separate code path that nevertheless has the same issue, unpatched, and ought to receive a similar fix.

Reproducible: Always

Steps to Reproduce:
1. In a terminal, run gwenview with more than one local file given in the arguments.
2. Observe gwenview start but not load any images. Take a look in gwenview's folder under /tmp to see the .desktop files it created.

Actual Results:  
Gwenview starts but not load any images. gwenview's folder under /tmp has a bunch of .desktop files  referring to http://[a filename here].

Expected Results:  
Gwenview shows images because the /tmp folder contains symlinks to the local files.
Comment 1 Nate Graham 2017-09-08 19:36:10 UTC
Interesting bug. I can't reproduce it in KDE Neon with Gwenview 17.11.70, though. Gwenview properly opens showing both files, and no .desktop files appear in /tmp.
Comment 2 Brendon Higgins 2017-09-08 20:01:21 UTC
Still reproducible with the packages in Debian testing, but investigating the git logs, it looks like commit 3d0531c0f253e469126b463f0dfb374a19dee641 by Antonio Larrosa (now almost a year ago!) most likely has addressed this bug. Good to know. Thanks!