Bug 355001 - [Regression] [Patch] marble-kde cannot open local files
Summary: [Regression] [Patch] marble-kde cannot open local files
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 1.12 (KDE Applications 15.08)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-07 18:05 UTC by Stefan Bauer
Modified: 2015-11-22 18:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Bauer 2015-11-07 18:05:49 UTC
Steps to reproduce:
- Open the marble KDE application
- Select File -> Open
- Select a GPX file from the local file system

Expected result: Marble opens the file
Current result: Message box: Sorry, unable to open ''. The file is not accessible.

Analysis
The problem seems to be in the method MarblePart::openFile(). It opens a QFileDialog to get the path of the file to open as QString. Then it calls MarblePart::openUrl( const QUrl &url ) with this QString. As this method takes a QUrl, not a QString, the QUrl(const QString&) ctor is called. The resulting QUrl is broken as it does not contain the protocol part.

Looks like this got screwed up in cf1158852b8905d2c22d68c139aa4f0935207844 (Port to KDE Frameworks 5). There the interface of MarblePart::openUrl() was changed to take a QUrl instead of a KUrl. KUrl had special treatments for paths which QUrl does not have.

I'm currently working on/testing a fix.
Comment 2 Dennis Nienhüser 2015-11-22 18:00:47 UTC
Git commit 5f09ad0fc33627aff7d13ddff64d2f6d7b035fb8 by Dennis Nienhüser, on behalf of Stefan Bauer.
Committed on 22/11/2015 at 17:59.
Pushed by nienhueser into branch 'master'.

MarblePart::openFile(): Create a working QUrl from the selected files

The file open dialog returns the path(s) as QString.
MarblePart::openUrl() expects a QUrl.
The previous implicit conversion from QString to QUrl creates broken
QUrl instances because the file:// protocol is missing.
Fix this by calling QUrl::fromLocalPath() explicitly.

M  +1    -1    src/apps/marble-kde/marble_part.cpp

http://commits.kde.org/marble/5f09ad0fc33627aff7d13ddff64d2f6d7b035fb8
Comment 3 Dennis Nienhüser 2015-11-22 18:03:44 UTC
Git commit 04aeb609932880caf0fe7103792039a497c4c5df by Dennis Nienhüser, on behalf of Stefan Bauer.
Committed on 22/11/2015 at 18:03.
Pushed by nienhueser into branch 'Applications/15.12'.

MarblePart::openFile(): Create a working QUrl from the selected files

The file open dialog returns the path(s) as QString.
MarblePart::openUrl() expects a QUrl.
The previous implicit conversion from QString to QUrl creates broken
QUrl instances because the file:// protocol is missing.
Fix this by calling QUrl::fromLocalPath() explicitly.
(cherry picked from commit 5f09ad0fc33627aff7d13ddff64d2f6d7b035fb8)

M  +1    -1    src/apps/marble-kde/marble_part.cpp

http://commits.kde.org/marble/04aeb609932880caf0fe7103792039a497c4c5df