Bug 377349

Summary: QFileDialog (using KDEs file dialog): open button is enabled even when no file is selected, and does nothing when clicked
Product: [Plasma] plasma-integration Reporter: Frank Schaefer <fschaefer.oss>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: descartavel1, kdelibs-bugs-null, nate, nicolas.fella
Priority: NOR Keywords: usability
Version First Reported In: 5.9.5   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: Frameworks 6.14
Sentry Crash Report:

Description Frank Schaefer 2017-03-07 19:07:10 UTC
Using KDEs native file dialog, the open/save button of QFileDialog::getOpenFileName, getSaveFileName() etc. is enabled even if no file is selected

Steps to reproduce:
e.g. QFileDialog::getOpenFileName(this, "Open", QCoreApplication::applicationDirPath());
=> dialog shows application directory with no file selected, but Open/Save button is enabled.
Comment 1 Frank Schaefer 2017-03-07 19:09:10 UTC
Used Qt version is 5.7.1.
Comment 2 Nate Graham 2020-09-08 14:59:12 UTC
Can you still reproduce this with Plasma 5.19?
Comment 3 Frank Schaefer 2020-09-12 12:38:49 UTC
Yes.
Comment 4 Gabriel Barros 2023-09-27 19:31:22 UTC
isn't this expected behaviour. The current dir is "selected" and will be returned if you press open/save.

i believe you have to pass options such as QFileDialog::AnyFile to force one file selection. I might be wrong.
Comment 5 Nate Graham 2023-09-28 19:00:05 UTC
Well, then there's no file selected, clicking the Open button in the file chooser dialog (as opposed to the folder or file+folder chooser dialog) will do nothing when clicked.

Anyway, can confirm the issue.
Comment 6 Nicolas Fella 2025-08-05 21:35:03 UTC
This seems to be fixed with https://invent.kde.org/frameworks/kio/-/commit/debd9fd15a6fae6d745fa6f3b0e5e812ac163162