Bug 342876 - Location runners show results for directories which do not exist
Summary: Location runners show results for directories which do not exist
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: locations (show other bugs)
Version: 5.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-15 16:01 UTC by cferr
Modified: 2020-10-25 14:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cferr 2015-01-15 16:01:37 UTC
Every time I try to open a directory with the "Run command" interface by typing its name, if I'm misspelling it by adding it capital letters, that is to say I'm entering the right name with a wrong case, the "Dolphin" file manager icon still shows up. The command button that shows up still says "Open /home/Corentin" for example, while /home/Corentin does not exist (it is /home/corentin), like it would do for a directory that actually existed.

Reproducible: Always

Steps to Reproduce:
1. Open Krunner (Alt+F2 or whatever shortcut you may use),
2. Type a directory name, but voluntarily do a case error,
3. See what happens.

Actual Results:  
 KRunner is thinking the directory exists by behaving the same way as existent dirs, while this is not the case.

Expected Results:  
Krunner should be saying "Go to file://home/Corentin" with a blue folder icon instead, like when I type the path to a non-existent location. Even better, the Locations plugin should not be adding a button "Go to file://..." when it knows the file or directory doesn't exist (when you click the button, you get an "Error" dialog box that warns you the file you are looking for does not exist...)
Comment 1 Vishesh Handa 2015-01-15 16:20:19 UTC
I agree with not showing the "Go to file://..." if the file doesn't exist.

however, the case in-sensitivity was specially designed (and it was hard to get right, and it still doesn't work perfectly), so I'm not too keen on drop that. From what I understand the usability guys seem to think case-insensitivity is a good thing.

PS: Please mark version numbers.
Comment 2 cferr 2015-01-15 16:35:13 UTC
(In reply to Vishesh Handa from comment #1)
> I agree with not showing the "Go to file://..." if the file doesn't exist.
> 
> however, the case in-sensitivity was specially designed (and it was hard to
> get right, and it still doesn't work perfectly), so I'm not too keen on drop
> that. From what I understand the usability guys seem to think
> case-insensitivity is a good thing.
> 
> PS: Please mark version numbers.

Sorry for the version number, it is 1.0 (the "About" bow shows "Location, Version 1.0") yet this number is not listed. My version of KDE is 4.13.3, and it doesn't appear as well.

Well, if this is a feature rather than a bug, then is it normal to get an "Error" box appear when I'm incorrectly spelling the name and I press Enter, instead of just correcting it for me and opening the directory with Dolphin?  Has this feature been designed for use with case-insensitive filesystems only?
Comment 3 Vishesh Handa 2015-01-15 16:57:43 UTC
(In reply to Cocodidou from comment #2)
> 
> Well, if this is a feature rather than a bug, then is it normal to get an
> "Error" box appear when I'm incorrectly spelling the name and I press Enter,
> instead of just correcting it for me and opening the directory with Dolphin?
> Has this feature been designed for use with case-insensitive filesystems
> only?

With Plasma 5.1, It will automatically choose the right case no matter how you type it.  But it still does show "goto file /home/t" even if t doesn't exist.

I'm afraid I cannot backport any of these changes to the 4.x series. So the only way you'll get updates is by moving to Plasma 5.

I'm changing the version number to 5.x since that way I won't forget about it.
Comment 4 Bug Janitor Service 2020-10-11 08:56:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/348
Comment 5 Alexander Lohnau 2020-10-19 11:49:16 UTC
Git commit b62fe57e799ec73c622998116a984042a4f8641a by Alexander Lohnau.
Committed on 19/10/2020 at 11:48.
Pushed by alex into branch 'master'.

Do check if file exists manually
FIXED-IN: 5.21

M  +4    -2    runners/locations/locationrunner.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/b62fe57e799ec73c622998116a984042a4f8641a
Comment 6 Alexander Lohnau 2020-10-25 14:48:08 UTC
Git commit d398508a19eda9ad4d5049f3b0fe9259f81263f7 by Alexander Lohnau.
Committed on 25/10/2020 at 14:47.
Pushed by alex into branch 'master'.

Do not set the type to File/Directory if it does not exist

This behavior is different from what the docs say and very
questionable.

M  +3    -0    autotests/runnercontexttest.cpp
M  +14   -100  src/runnercontext.cpp

https://invent.kde.org/frameworks/krunner/commit/d398508a19eda9ad4d5049f3b0fe9259f81263f7