Qftp FtpWindow Example Issue: No Progress On Download



  • I have a weird issue: If I use the sample program as is it works fine, I can view the files on my ftp server and download selected files, no problem. HOWEVER, the project I'm working on only needs one file to be downloaded, it's always in the same spot, always present etc. So I'd like the modified version to simply get the file as soon as the user presses the Connect button. Behind the scenes inside FtpWindow::ftpCommandFinished() in the section for QFtp::List I have:

    @
    if (ftp->currentCommand() == QFtp::List) {
    if (isDirectory.isEmpty()) {
    fileList->addTopLevelItem(new QTreeWidgetItem(QStringList() << tr("<empty>")));
    fileList->setEnabled(false);
    }
    // what xml config files did we encounter?
    for( int i = 0; i < fileList->topLevelItemCount(); i++ ){
    QTreeWidgetItem *it = fileList->topLevelItem(i);
    if( it->text(0).indexOf("myfile") != -1 ) {
    fileList->setCurrentItem(it);
    downloadButton->setEnabled(true);
    downloadFile(); <===> // downloadFile() ! ! ! !
    break;
    }
    }

        return;
    }
    

    @

    Long story short: if I try to automate the selection of the file, the progress bar appears but never gets updated (never gets the dataTransferProgress signal). In the above code, if I comment out the downloadFile() and selected it manually with my mouse click then all's well. Arrrg! I've verified that the file provided in the ftp->get() is in fact non-zero and valid. Spent way too long on this already. If anyone has any suggestions I'd be very appreciative ;-)

    Thanks,
    Ian


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.