Strange KFileDialog ctor

David Faure faure at kde.org
Fri Sep 19 22:58:22 BST 2008


On Thursday 18 September 2008, Christian Ehrlicher wrote:
> inside the ctor setFilter() is used which then has to determine that 
> it's a joined-mimetype string and has to split it up.
>
> Therefore I suggest a new ctor:
> 
>      KFileDialog( const KUrl& startDir, const QStringList& mimefilter,
>                   QWidget *parent, QWidget* widget = 0 );
> 
> to avoid the useless join/split
> 
> Comments?

You can just use setMimeFilter(const QStringList&, ...) instead.
As you can see, this method also allows to specify which
type should be used by default, when saving.

OTOH a ctor without any filter argument would make the usage of
setMimeFilter more self-evident than having to pass QString() to the filter arg.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list