Bug 340418 - Local files are treated as URLs when placed on command line
Summary: Local files are treated as URLs when placed on command line
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (other bugs)
Version First Reported In: Git (add output of "git log -1 --oneline" to description)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-28 06:38 UTC by Luca Beltrame
Modified: 2014-10-29 13:54 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Beltrame 2014-10-28 06:38:20 UTC
In recent Gwenview master, local files are handled like http:// urls when loading them from the command line.

 As an example, 

gwenview foo.jpg

will make gwenview appear with

http://foo.jpg 

in its address bar, causing loading to fail.
This is probably an issue with the use of QUrl in the code,  Perhaps solutions like the ones outlined in http://lists.kde.org/?t=141358591200002&r=1&w=2 or using 

 QUrl::url(QUrl::PreferLocalFile)

if possible.

Reproducible: Always

Steps to Reproduce:
1. Launch gwenview from a terminal with one file 


Actual Results:  
File path is transformed into http://<file name>

Expected Results:  
http should not be prepended to the path
Comment 1 Lukáš Tinkl 2014-10-29 13:54:54 UTC
Git commit 7d6bca74c699150e1ed1ee801da98a3bb5f00d95 by Lukáš Tinkl.
Committed on 29/10/2014 at 13:52.
Pushed by lukas into branch 'master'.

fix "Local files are treated as URLs when placed on command line"

treat URLs w/o a scheme and w/o a leading slash as relative file paths;
on Qt 5.4 use the correct augmented version of
QUrl::fromUserInput(input, cwd)

M  +12   -2    app/main.cpp

http://commits.kde.org/gwenview/7d6bca74c699150e1ed1ee801da98a3bb5f00d95