Bug 472715 - KDialog shows file selector instead of folder selector
Summary: KDialog shows file selector instead of folder selector
Status: RESOLVED FIXED
Alias: None
Product: kdialog
Classification: Applications
Component: general (show other bugs)
Version: 23.04.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Brad Hards
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-27 19:54 UTC by Grósz Dániel
Modified: 2023-09-05 20:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot (70.87 KB, image/png)
2023-07-27 19:54 UTC, Grósz Dániel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Grósz Dániel 2023-07-27 19:54:52 UTC
Created attachment 160573 [details]
Screenshot

SUMMARY
kdialog --getexistingdirectory shows a regular file dialog instead of a folder dialog. And it's hard to use if a single click is configured to open a file/folder, since clicking a folder opens it inside the dialog rather than selecting it, and Open doesn't work if no folder is selected.

STEPS TO REPRODUCE
1. kdialog --getexistingdirectory
2. Click a folder.
3. Click Open.

OBSERVED RESULT
1. The sort of dialog used to select a regular file.
2. The folder is opened.
3. Nothing.

EXPECTED RESULT
1. A folder selection dialog.
2. The folder is selected.
3. The dialog returns the selected folder.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20230724
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Kernel Version: 6.4.3-1-default (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Just like Bug 419874, except that affected more (all?) applications. This time, I've only seen it in kdialog; the usual folder selection dialog is used both by KDE applications and Firefox.
Comment 1 Oded Arbel 2023-08-27 09:39:08 UTC
The change from directory selector dialog to a file selector dialog was done in this commit: https://invent.kde.org/utilities/kdialog/-/commit/633667a373a690e636c6d7c231c0d9700f62473b

The commit comment doesn't really explain the reason for the change - as far as I can tell, KDirSelectDialog is still a thing that exists.

There are two issues here:

1. the change of UI to something that is arguably less appropriate.
2. If the user wants to accept the default - there's no longer an easy way to do that.
Comment 2 Bug Janitor Service 2023-08-27 10:04:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kdialog/-/merge_requests/29
Comment 3 Grósz Dániel 2023-08-27 11:05:07 UTC
It looks like KDirSelectDialog was in KDELibs4Support.
Comment 4 Oded Arbel 2023-08-27 11:08:26 UTC
(In reply to Grósz Dániel from comment #3)
> It looks like KDirSelectDialog was in KDELibs4Support.

It is available in plasma-integration - which is installed on my system, but it doesn't have a `dev` package (in Neon), so I don't know how to get the development files.
Comment 5 Oded Arbel 2023-08-27 15:12:30 UTC
Correction: the problem wasn't where I pointed at, but in https://invent.kde.org/utilities/kdialog/-/merge_requests/17, which the new MR fixes.
Comment 6 Oded Arbel 2023-09-05 17:36:10 UTC
Update on the MR: it got two reviews and an approval. Now just waiting for someone to click the "Merge" button.
Comment 7 Albert Astals Cid 2023-09-05 20:37:07 UTC
Git commit 7b20cb0450bb00bb555a44349d914e88cc633a41 by Albert Astals Cid, on behalf of Oded Arbel.
Committed on 05/09/2023 at 22:37.
Pushed by aacid into branch 'master'.

Fixes bug 472715: use Qt directory selector to select an existing directory

Unlike what I said in the connected bug report, the problem was not in the removal of KDirSelectDialog but in the incorrect addition of `setFileMode()`.

I went a bit back and forth on the minimal fix (I should have tested more), and I apologize for the noise.

Hopefully you can accept this minimal change quickly.

M  +1    -1    src/kdialog.cpp

https://invent.kde.org/utilities/kdialog/-/commit/7b20cb0450bb00bb555a44349d914e88cc633a41