[PATCH] KURLRequester and broken filter

Tobias Koenig tokoe at kde.org
Fri Feb 4 00:27:22 GMT 2005


Hi,

with the current implementation of KURLRequester you can see the
following behaviour:
  Open the desktop background config module and choose a background widget
  by clicking the '...' button of the KURLRequester. In the appearing
  dialog, only image files are shown (expected behaviour).
  When you now close this dialog and open it again, _all_ files are
  shown.

The problem seems to be, that the filter of the KFileDialog
is set too late in KURLRequester::fileDialog(). Instead of calling
  myFileDialog->setFilter( filter )
the attached patch passes the filter directly in the ctor of the
dialog. This fixes the strange behaviour.

For this case the problem is solved, but what's about using
KFileDialog standalone? Shouldn't the dirlister be updated whenever a
new filter is set?

Is the patch ok to commit?

Ciao,
Tobias
-- 
Separate politics from religion and economy!
-------------- next part --------------
Index: kurlrequester.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kfile/kurlrequester.cpp,v
retrieving revision 1.60
diff -p -u -b -r1.60 kurlrequester.cpp
--- kurlrequester.cpp	20 Jan 2005 09:16:32 -0000	1.60
+++ kurlrequester.cpp	4 Feb 2005 00:20:53 -0000
@@ -339,11 +339,10 @@ KFileDialog * KURLRequester::fileDialog(
 {
     if ( !myFileDialog ) {
 	QWidget *p = parentWidget();
-	myFileDialog = new KFileDialog( QString::null, QString::null, p,
+        myFileDialog = new KFileDialog( QString::null, d->fileDialogFilter, p,
 					"file dialog", true );
 
 	myFileDialog->setMode( d->fileDialogMode );
-        myFileDialog->setFilter( d->fileDialogFilter );
         myFileDialog->setCaption( caption() );
     }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050204/12719490/attachment.sig>


More information about the kde-core-devel mailing list