Bug 353883 - "Invalid Protocol" when entering relative paths
Summary: "Invalid Protocol" when entering relative paths
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: URL navigator (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-14 07:56 UTC by tesfabpel
Modified: 2022-08-20 13:52 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.98


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tesfabpel 2015-10-14 07:56:25 UTC
If you edit the path and enter a relative location (for example ".config" when you are in ~), Dolphin refuses to go there and says "Protocol not found" and the path in the location bar becomes empty...

Reproducible: Always

Steps to Reproduce:
1. Go to the any directory (eg. the home directory).
2. Enter a relative path (eg. ".config")
3. Press enter to confirm

Actual Results:  
Dolphin gives an error saying "Protocol not found" and the path in the location bar becomes empty.

Expected Results:  
Dolphin should (maybe at last resort) try to append the relative URL to the current directory (pwd) and try again with the file protocol. 
Only then, if the path doesn't exists, give the error.
Comment 1 Emmanuel Pescosta 2015-10-15 19:17:48 UTC
Thanks for the bug report, I can reproduce the problem.

This is a bug in the KUrlNavigator, I'll reassign it to KIO.
Comment 2 Loucura 2021-10-23 15:27:11 UTC
I was going to report a new bug, but this one seems close enough to what I found.
Testing with the latest KDE Neon (happens with older versions as well).

It seems errors only happen when entering a relative path that has a dot somewhere.
Without dots, it works fine.
Absolute paths work fine too.

Absolute paths:
/home/neon/Documents -> fine
/home/neon/.local    -> fine

Relative paths (inside ~):
Documents       -> fine
.config         -> Invalid protocol
.local/share    -> Invalid protocol
Test.Folder     -> Dolphin does not support web pages (tries https protocol)

Relative paths (inside /home):
neon/Documents  -> fine
neon/.config    -> Dolphin does not support web pages (tries https protocol)

So, I guess that when the path starts with '/', Dolphin knows it's a file path.
But, when it doesn't start with '/' (or a protocol scheme like "ssh://") but the path includes a dot, it thinks it's not a folder path, and may even think it's a web URL.

The location bar in Dolphin correctly autocompletes relative paths, though.

Maybe when the path doesn't start with '/' and doesn't include "://" somewhere, the system should check if a file/folder with that relative path exists and:
- If it exists -> open that file/folder;
- If it doesn't exist -> proceed to do what it does currently.
Or something like that.

Maybe the title of this issue should be updated. (I would, but I don't know if I should).
Comment 3 Ahmad Samir 2022-08-20 13:52:23 UTC
Git commit d2d81ca6ed0653823b77b2cab3c404dd71bf8fef by Ahmad Samir.
Committed on 20/08/2022 at 13:19.
Pushed by ahmadsamir into branch 'master'.

KUrlNavigator: check if typed text matches a relative dir first

Test plan:
- Open e.g. Dolphin at ~/, in the url bar replace all the text with
  ".config", Enter
- it displays an error "Invalid protocol"
- Apply patch and try again, it should open ~/.config as expected
FIXED-IN: 5.98

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

https://invent.kde.org/frameworks/kio/commit/d2d81ca6ed0653823b77b2cab3c404dd71bf8fef