Bug 319700

Summary: [PATCH] Dolphin doesn't understand relative paths
Product: [Frameworks and Libraries] frameworks-kio Reporter: tesfabpel
Component: URL navigatorAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: minor CC: claudius.ellsel, emmanuelpescosta099, frank78ac, kdelibs-bugs, nate
Priority: NOR Keywords: junior-jobs, reproducible, usability
Version: 5.47.0   
Target Milestone: ---   
Platform: Other   
OS: Unspecified   
Latest Commit: Version Fixed In: 5.78
Attachments: Invalid protocol error
Screenshot: weird path in the location bar
Fix the handling of relative paths (Dolphin workaround)

Description tesfabpel 2013-05-12 06:26:44 UTC
When editing the location in the location bar, if I am in /home/user/ and I want to go to Documents, it gives the error: "Invalid protocol" if I write Documents/ (not /home/user/Documents), even though Dolphin suggests me the folder.
After that the path in the location bar becomes strange if you click on the Done button on the right.
If you open a folder and press the go back button, it doesn't do anything at all...

Reproducible: Always

Steps to Reproduce:
1. Open dolphin.
2. Edit the path in the location bar and write the name of a folder __relatively__ to the current location.
3. It gives you the error: "Invalid protocol"
4. Click on the Done button on the right, the location bar now reports something like this " : "
5. Open a folder and click go back.
Actual Results:  
It doesn't work.

Expected Results:  
It should work :P
Comment 1 tesfabpel 2013-05-12 06:28:40 UTC
Created attachment 79841 [details]
Invalid protocol error
Comment 2 tesfabpel 2013-05-12 06:29:50 UTC
Created attachment 79842 [details]
Screenshot: weird path in the location bar
Comment 3 Frank Reininghaus 2013-05-12 06:40:55 UTC
Thanks for the bug report. I can confirm the problem.
Comment 4 Emmanuel Pescosta 2013-07-24 18:48:37 UTC
Created attachment 81323 [details]
Fix the handling of relative paths (Dolphin workaround)

I think this problem should be fixed within KUrlNavigator, so that the urlAboutToBeChanged(KUrl) and urlChanged(KUrl) signals always send absolute urls.

@Frank:
What do you think?
Comment 5 Frank Reininghaus 2013-07-24 20:45:23 UTC
Thanks Emmanuel for the patch! I agree that fixing this in KUrlNavigator might be the best option. Then it would also work correctly in the "File Open" dialog.
Comment 6 Nate Graham 2018-06-15 03:36:20 UTC
Would you like to formally submit your patch, Emmanuel?
Comment 7 David Faure 2020-12-12 10:44:07 UTC
Git commit 61912633cfc7792b4a3e905ea601318d9e3e85d2 by David Faure, on behalf of Ahmad Samir.
Committed on 12/12/2020 at 10:43.
Pushed by dfaure into branch 'master'.

KUrlNavigator: resolve relative dir paths

When the current url is e.g. /path/to/foo/, and the user replaces all the
text in the url box with "folder", which happens to be a dir in /path/to/foo/,
upon pressing Enter, we resolve the text to /path/to/foo/folder; this seems
more useful.

Hide the new method, uncommittedUrlAsync(), in the d-pointer; the original
method, ucommittedUrl(), doesn't seem to be used by any KDE code other than
the KUrlNave unit tests, but that can still work if we make it a member of
the Private class and make the unit test a friend... etc; the public
uncommittedUrl() should probably be deprecated.

Add a unit test.
FIXED-IN: 5.78

M  +48   -0    autotests/kurlnavigatortest.cpp
M  +2    -0    autotests/kurlnavigatortest.h
M  +55   -22   src/filewidgets/kurlnavigator.cpp

https://invent.kde.org/frameworks/kio/commit/61912633cfc7792b4a3e905ea601318d9e3e85d2
Comment 8 David Faure 2020-12-12 10:44:15 UTC
Git commit 66360b63d8364991f0a6ec1d1f1c88882dbb708f by David Faure, on behalf of Ahmad Samir.
Committed on 12/12/2020 at 10:43.
Pushed by dfaure into branch 'master'.

KUrlNavigator: make completions of relative paths work

Call KUrlCompletion::setDir() when the current url changes, so that
completions of paths relative to the current url work; otherwise the url
box would always offer relative completions consisting of dirs under $HOME,
even when the current url isn't $HOME.

M  +5    -0    src/filewidgets/kurlnavigator.cpp

https://invent.kde.org/frameworks/kio/commit/66360b63d8364991f0a6ec1d1f1c88882dbb708f