Bug 400725 - Select application should not run first app from multiple choice
Summary: Select application should not run first app from multiple choice
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-06 02:35 UTC by Alexander Potashev
Modified: 2020-02-03 08:40 UTC (History)
2 users (show)

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


Attachments
screenshot (26.80 KB, image/png)
2018-11-06 02:36 UTC, Alexander Potashev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Potashev 2018-11-06 02:35:16 UTC
SUMMARY
The "select application" dialog should not run first app from multiple choice on pressing Enter.

STEPS TO REPRODUCE
1. In Dolphin, RMB click on a file, select "Open With..."
2. In the dialog enter "ark", it will find "Wireshark" and "Ark" on my computer.
3. Press Enter.

OBSERVED RESULT
Runs Wireshark immediately.

EXPECTED RESULT
Should either do nothing or run the command "ark" like KRunner would do.

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 5.13.5
KDE Frameworks Version: 5.48.0
Qt Version: 5.11.1
Comment 1 Alexander Potashev 2018-11-06 02:36:04 UTC
Created attachment 116117 [details]
screenshot
Comment 2 Ahmad Samir 2019-09-23 23:08:48 UTC
The difference between krunner and the open with dialogue is that the latter sorts the filter results by category and "Internet" comes before "Utilities" (I don't know the language in the screenshot, so I don't know if it's ordered alphabetically too or not).
Comment 3 Ahmad Samir 2019-09-25 17:06:42 UTC
Feel free to reopen if you disagree.
Comment 4 Alexander Potashev 2019-09-25 17:22:47 UTC
I don't get how sorting is related to the problem.
Comment 5 Ahmad Samir 2019-09-25 22:29:15 UTC
You compared the behaviour of the open with dialogue to krunner; krunner doesn't care which category the application belongs to in the menu, so it shows "Ark" first.

The open with dialogue displays the results, but sorts them by category. And it indicated which one is selected, which happens to be wireshark.
Comment 6 Alexander Potashev 2019-09-25 23:43:35 UTC
Ok, please better ignore my statement about krunner. Let me say what I suggest in other words:

EXPECTED RESULT
Should either
 1. do nothing, or
 2. run the command "ark", completely ignoring what appers in the filtered list.
Comment 7 Ahmad Samir 2019-09-26 21:26:04 UTC
Ah, OK, I see your point now.
Comment 8 Ahmad Samir 2019-11-19 17:19:21 UTC
https://phabricator.kde.org/D24951
Comment 9 Ahmad Samir 2020-02-03 08:40:47 UTC
Git commit efa5438e39bbff7bd1ade48120b1d19fdea3a515 by Ahmad Samir.
Committed on 03/02/2020 at 08:40.
Pushed by ahmadsamir into branch 'master'.

[KOpenWithDialog] Automatically select the result if the model filter has only one match

Summary:
If the user types some text in the lineEdit and there's more than one
match in the model view, don't automatically select the first match, so
that if the user presses Enter/Return, we don't load the first result
as it could well be not what the user actually wants.

Test Plan:
- Make sure ark and wireshark are installed on your system
- Invoke the open-with dialog on any archive file, and type ark
- You should get two results (or three if Ark is present in two individual
  categories on your system...) WireShark and Ark, with the former being
  automatically selected for you
- Press Enter, the file is opened with wireshark
- Apply the diff then try again, the open-with dialog will not select
  the first result, and if you press Enter the dialog will open the file
  using the command you typed

Reviewers: dfaure, ngraham, #frameworks, #vdg

Reviewed By: dfaure

Subscribers: ngraham, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24951

M  +7    -5    src/widgets/kopenwithdialog.cpp

https://commits.kde.org/kio/efa5438e39bbff7bd1ade48120b1d19fdea3a515