Bug 271400

Summary: When multi-selection is allowed and folders as well as files are selected, disregard folder selection and only open files
Product: [Frameworks and Libraries] frameworks-kio Reporter: Todd <toddrme2178>
Component: Open/save dialogsAssignee: KIO Bugs <kio-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: bugseforuns, kdedev, kdelibs-bugs-null, nate, nicholaspnowak
Priority: NOR Keywords: junior-jobs, usability
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.14
Sentry Crash Report:

Description Todd 2011-04-21 04:22:58 UTC
Version:           unspecified (using KDE 4.6.2) 
OS:                Linux

When using tree mode (or detailed tree mode), it is easy to select sub-folders and the files in the sub-folders, but much harder to select just the files.  Many programs cannot handle folders, and you will get an error if you try to open the files when you also have the folder selected, telling you the program cannot handle folders.  This error forces you to go back and manually deselect the folders.  It would be nice if this error had a "only open files" button, which would strip out the folders and just open the files you selected.

There should be no cost to users for this.  It would make it much easier to open files in tree mode, but users would still get the error message so if they made a mistake they would be able to correct it.

Reproducible: Always
Comment 1 Nick Nowak 2025-04-07 03:47:36 UTC
An alternative way of handling this would be to remove the error message all together and highlight files only when shift/ctrl+clicking. This is the way it works on MacOS. 

I'm new to KDE but might take a stab at this as starter project
Comment 2 Bug Janitor Service 2025-04-07 11:27:04 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1859
Comment 3 Akseli Lahtinen 2025-04-09 16:47:58 UTC
Git commit debd9fd15a6fae6d745fa6f3b0e5e812ac163162 by Akseli Lahtinen.
Committed on 09/04/2025 at 16:47.
Pushed by akselmo into branch 'master'.

KFileWidget: Ignore selected folders during file selection

During file selection, there's no reason to add the selected
folder to the url bar (thus making it selected). User can still visually
select the folder.

Instead, just ignore any selected folders and add only files.
We can then delete the folder checking while loop.

This does not affect directory selection.
FIXED-IN: 6.14

M  +17   -27   src/filewidgets/kfilewidget.cpp

https://invent.kde.org/frameworks/kio/-/commit/debd9fd15a6fae6d745fa6f3b0e5e812ac163162