Results 1 to 6 of 6

Thread: QFtp returning incorrect value in dataTransferProgress signal.

  1. #1
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QFtp returning incorrect value in dataTransferProgress signal.

    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.

  2. #2
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QFtp returning incorrect value in dataTransferProgress signal.

    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.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFtp returning incorrect value in dataTransferProgress signal.

    Could you prepare a minimal compilable example reproducing the problem?

  4. #4
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QFtp returning incorrect value in dataTransferProgress signal.

    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.
    Last edited by Memnoch; 22nd January 2009 at 00:38.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFtp returning incorrect value in dataTransferProgress signal.

    The example seems to work fine for me on Linux/4.4.3 - the progress bar is updating correctly.

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QFtp returning incorrect value in dataTransferProgress signal.

    Quote Originally Posted by Memnoch View Post
    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?
    J-P Nurmi

Similar Threads

  1. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  2. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.