[patch] Native mode for KFileDialog

Jarosław Staniek js-oCjyBhvHQAU at public.gmane.org
Fri Jun 13 21:39:45 BST 2008

(for review)

Add native mode to KFileDialog without affecting its API

It is useful for MS Windows (and Mac?) for improving native experience.
Users demanding powerful facilities of KDE dialogs can set the following in 

[KFileDialog Settings]

The same setting shall be available in the forthcoming "Integration" page of 
KDE system settings on Windows/Mac.

- qtFilter() added for converting filters from KDE format to Qt format
- In KDE code, KFileDialog instances are allocated and QDialog::exec() is 
executed; since we are using static QDialog functions in the native mode, 
exec() is reimplemented  to call them
- KFileDialogPrivate::Native member added for storing information for 
KFileDialog instances so we know what to do when exec() is called; moreoved 
selectedUrl*() and selectedFile() methods work as expected for native mode too
- on the other hand, static functions like KFileDialog::getOpenFileName(), 
check the "native" setting directly using static bool 
- setMimeFilter() sets filter for use in Qt dialogs
- KFileWidget is instantiated as the code uses its subwidgets but we do not 
show any widget, it does not seem to be overhead
- to add more consistency, KFileDialog::getExistingDirectory*() functions use 
native dialog only for native mode (before native dialog was always used 
through #ifdef'd code on Windows)
- _qt_filedialog_*_hook hooks are now only used for KDE mode; and similarly to 
getExistingDirectory*() change, qt_filedialog_existing_directory_hook is set 
for KDE mode on Windows too; make KFileDialogQtOverride a class since it looks 
and smells like a class
- fix declaration of _qt_filedialog_*_hook functions: Qt exports them using 
Q_GUI_EXPORT, not C linkage as "extern" word would suggest before

regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
  KDE Libraries for MS Windows (http://windows.kde.org)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: native_kfiledialog.patch
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080613/b4c0c6f4/attachment.ksh>
-------------- next part --------------
Kde-windows mailing list
Kde-windows-RoXCvvDuEio at public.gmane.org

More information about the kde-core-devel mailing list