Hi Everyone,
I have been trying to use QUrlOperator to copy some files from one loaction to another. The strange thing is that I keep on receiving dataTransferProgress signal and the progress bar advances but no file is created and everything goes normal untill I get a finished signal but nothing is copied. After waiting for some more time I found out that I keep on receiving dataTransferProgress signal and then a finished signal and this time the file is copied! This second time gets started without any interaction from me.

I am using Qt 3.3.7 under Linux Kubuntu feisty.

Here is my code:

Qt Code:
  1. void MyClass::CopyMarked(bool move)
  2. {
  3. // m_currDir = "/tmp";
  4. if (m_markedList.isEmpty())
  5. return;
  6.  
  7. QString msg = (move) ?
  8. tr("Moving marked files...") : tr("Copying marked files...");
  9.  
  10. //.....
  11. // Here a seelctor dialog appears to choose the destination
  12. //......
  13. if(selector.exec() == QDialog::Accepted){
  14. QUrlOperator* copyOperator = new QUrlOperator;
  15.  
  16. int size = 0;
  17. QString msg;
  18. //m_markedList contains the names of the files to be copied or moved
  19. for (unsigned int i = 0; i < m_markedList.count() ; i++)
  20. {
  21. QFile file(*m_markedList.at(i));
  22. size += file.size();
  23. }
  24.  
  25. m_copyProgress = new MythProgressDialog(msg, size);
  26.  
  27. connect(copyOperator,SIGNAL(dataTransferProgress(int,int,QNetworkOperation*)),
  28. this,SLOT(dataTransferProgress(int,int,QNetworkOperation*)));
  29.  
  30. connect(copyOperator,SIGNAL(finished(QNetworkOperation*)),
  31. this,SLOT(finished(QNetworkOperation*)));
  32.  
  33. copyOperator->copy(m_markedList,selector.getSelected(),move);
  34. }
  35. }
  36.  
  37. void MyClass::dataTransferProgress(int bytesDone, int, QNetworkOperation*)
  38. {
  39. m_copyProgress->setProgress(bytesDone);
  40. }
  41.  
  42. void MyClass::finished(QNetworkOperation*)
  43. {
  44. m_copyProgress->close();
  45. }
To copy to clipboard, switch view to plain text mode 

Thanx in advance,
Ahmed Toulan.