Bug 440475

Summary: 'Allow folder expansion' option seems to be ignored in some contexts
Product: [Frameworks and Libraries] frameworks-kio Reporter: Kishore Gopalakrishnan <kishore96>
Component: Open/save dialogsAssignee: KIO Bugs <kio-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: kdelibs-bugs, nate
Priority: NOR    
Version: 5.84.0   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In: 5.86
Attachments: Screenshot showing a folder expanded even though the option is disabled.

Description Kishore Gopalakrishnan 2021-08-01 06:03:07 UTC
Created attachment 140433 [details]
Screenshot showing a folder expanded even though the option is disabled.

SUMMARY
When the user selects an item from the history in the 'name' textbox of the open/save dialog and the selected item is located in a subfolder of the currently viewed folder, the containing folder is expanded even though 'allow folder expansion in details view' is disabled in the options.

STEPS TO REPRODUCE
1. Open Kate
2. Ctrl+O, and make sure that 'allow expansion in details view' (in the 'options' button on the toolbar) is unchecked (there will be no 'expansion arrows' beside the folder names if this is disabled; you may have to check/uncheck it again for it to take effect).
3. Choose a pre-existing file ~/dir1/dir2/A to open
4. Ctrl+O, and navigate to ~
5. Click the arrow on the right edge of the dropdown box in the place where you can enter the filename, select the entry '/home/$username/dir1/dir2/A'

OBSERVED RESULTS
On clicking an item in the history that has a full path, the user is shown an expanded tree view even though expansion is disabled (see screenshot).

EXPECTED RESULTS
The setting to disable folder expansion should be obeyed.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2021-08-02 20:32:37 UTC
Can confirm. The setting probably does not handle this use case.
Comment 2 Bug Janitor Service 2021-08-04 21:36:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/530
Comment 3 Ahmad Samir 2021-08-07 10:55:02 UTC
Git commit 51737430fcd963a04a4eddbb166114ae25430814 by Ahmad Samir.
Committed on 07/08/2021 at 10:54.
Pushed by ahmadsamir into branch 'master'.

KDirOperator: expand to url only in detail tree view

When "allow expansion" is disabled in the menu, the view type is KFile::Tree,
however when selecting an item from the location (Name:) combobox history,
the item model would expand to show the file; that should only happen if
"allow expansion" is enabled, i.e. when the view type is KFile::DetailTree.
FIXED-IN: 5.86

M  +11   -2    src/filewidgets/kdiroperator.cpp

https://invent.kde.org/frameworks/kio/commit/51737430fcd963a04a4eddbb166114ae25430814