Hi!

While testing the DCOP interface I found a problem with the file transfer 
request dialog:
When the file is set by the dialog creator, i.e. mainwin.cpp, either in the 
method where the DCOP call is processed or where a file information is taken 
from clipboard, the file ends up in the dialogs line edit but not in the file 
list.

Unfortunately the filedialog isn't at least positioned at the given directory, 
nor does the user get any warning, because the check in 
UserSendFileEvent::sendButton just checks the line edit and it isn't empty.

How about this:

Check the file in setPath if it exists and is readable:
- if it is, also add the file to the file list
- it isn't, ignore it

Potential patch:

Index: usereventdlg.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/usereventdlg.cpp,v
retrieving revision 1.179
diff -u -3 -p -r1.179 usereventdlg.cpp
--- usereventdlg.cpp    5 Apr 2005 14:06:54 -0000       1.179
+++ usereventdlg.cpp    14 Apr 2005 20:42:57 -0000
@@ -30,6 +30,7 @@
 #include <qaccel.h>
 #include <qcheckbox.h>
 #include <qdatetime.h>
+#include <qfileinfo.h>
 #include <qvbox.h>
 #include <qvgroupbox.h>
 #include <qhgroupbox.h>
@@ -2894,8 +2895,12 @@ void UserSendFileEvent::sendButton()

 void UserSendFileEvent::setFile(const QString& file, const QString& 
description)
 {
-  edtItem->setText(file);
-  setText(description);
+  QFileInfo fileinfo(file);
+  if (fileinfo.exists() && fileinfo.isReadable())
+  {
+    edtItem->setText(file);
+    setText(description);
+  }
 }

 void UserSendFileEvent::resetSettings()


Cheers,
Kevin

Attachment: pgpBiGyQeSLHz.pgp
Description: PGP signature

Reply via email to