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
Created attachment 116117 [details] screenshot
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).
Feel free to reopen if you disagree.
I don't get how sorting is related to the problem.
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.
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.
Ah, OK, I see your point now.
https://phabricator.kde.org/D24951
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