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

Darío Andrés andresbajotierra at gmail.com
Sun Oct 11 15:48:53 BST 2009


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

(Updated 2009-10-11 14:48:53.674747)


Review request for kdelibs.


Changes
-------

Removed trailing space


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 (updated)
-----

  svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs/kio/kfile/kurlrequester.h 1033579 
  svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs/kio/kfile/kurlrequester.cpp 1033579 

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