PDA

View Full Version : QFtp returning incorrect value in dataTransferProgress signal.



Memnoch
17th January 2009, 01:59
Hello guys.

I've been having a problem with the QFtp's signal dataTransferProgress.
That signal is supposed to deliver 2 arguments with it. The amount of data that has been transfered and the total amount of data to be transfered. The problem is that no matter what I do, the value for total size is always "-1". I've read every possible document regarding QFtp and it says nothing about the value for total being -1. I am using QT 4.4.3 and Linux.

What could the problem be? Do you need code? Is this a possible bug?

Thank you for your time.

Memnoch
20th January 2009, 17:24
I have managed to resolve this issue with a little hack.
Still I would like to know if this is a bug.

I noticed that the problem only happened when I tried to download the first file from an FTP server, so I set up a small zero-filled file that I would download first so that the next downloads didn't have the problem.

I also tested the example included in QT and it has the same problem, only with the first download.

wysota
20th January 2009, 20:03
Could you prepare a minimal compilable example reproducing the problem?

Memnoch
22nd January 2009, 00:00
You can use the example that comes with QT that uses the QFtp class. I think it's called ftp.

If you try to download a big file the first time you run it, you will see that the progress bar will not update because the dataTransferProgress signal will be placing a "-1" as the total amount of data to transfer.

Or is it just me that has that problem (even with the shipped QT example)?

I should probably mention that I am using QT OpenSource 4.4.3 for Linux. Have not tested in Windows.

wysota
22nd January 2009, 07:01
The example seems to work fine for me on Linux/4.4.3 - the progress bar is updating correctly.

jpn
24th January 2009, 18:02
I noticed that the problem only happened when I tried to download the first file from an FTP server, so I set up a small zero-filled file that I would download first so that the next downloads didn't have the problem.
Does it happen with any FTP server?