Review Request: Allow KUrlRequest file dialog to be non-modal

Christoph Feck christoph at maxiom.de
Mon Sep 28 05:42:09 BST 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1716/#review2475
-----------------------------------------------------------


Applications that use this need to be careful, but generally a good and desired idea.

Regarding the naming, I think it should be "setFileDialogModal()" and "isFileDialogModal()" (or even without "File" because of the future directory dialog, not sure about the linker error, though)

I would say wait a couple of days and if there are no further objections, please commit that, there is more than Plasma's settings dialog that would benefit.

- Christoph


On 2009-09-27 21:43:16, Darío Andrés wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1716/
> -----------------------------------------------------------
> 
> (Updated 2009-09-27 21:43:16)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> The current KUrlRequester behavior is to use modal dialogs (for both selecting files and directories)
> This is sometimes not desirable as it causes blocks like the one described in bug 162616
> 
> This patch introduces two public functions: setModalFileDialog and modalFileDialog
> 
> The default behavior is to use modal=true (legacy)
> 
> I have adapted the code the set the modality of the file dialog and to use (or not) show() + signals and slots instead of exec()
> 
> - Known problem (fix later):
> 
> When KUrlRequester is set to select Directories, the static function "KFileDialog::getExistingDirectory" is used; so I tried different approaches to replace it:
> - Setting the KFileDialog to the directory mode will have a different GUI ("KFileDialog::getExistingDirectory" uses KDirSelectDialog; when KFileDialog with a directory mode uses a simple file dialog but hiding the file listing....). Using this method is going to change the "behavior" as another kind of dialog is going to be used. Also, the apidox of the class states that in Directory mode the KDirSelectDialog is used; and I think we shouldn't change this for compatibility reasons.
> - Using KDirSelectDialog + show() + signals and slots (I wasn't really sure about this; the first time I tried it, the linker complained; and I didn't wanted to add another link library and mess with KIO/KFile dependencies)
> 
> gkiakia commented that KFileDialog with a Directory mode having a different GUI than KDirSelectDialog could be a bug/inconsistency; but we don't know the code that much in order to try to fix it.
> 
> As I didn't found a better implementation I left the modal dialog for directories. (It should probably be commented in the apidox...)
> 
> 
> This addresses bug 162616.
>     https://bugs.kde.org/show_bug.cgi?id=162616
> 
> 
> Diffs
> -----
> 
>   svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs/kio/kfile/kurlrequester.h 1028323 
>   svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs/kio/kfile/kurlrequester.cpp 1028323 
> 
> Diff: http://reviewboard.kde.org/r/1716/diff
> 
> 
> Testing
> -------
> 
> Now the Picture Frame file selector do not block Plasma anymore :)
> Further testing would be needed
> 
> 
> Thanks,
> 
> Darío
> 
>





More information about the kde-core-devel mailing list