racinglocura07
24th June 2010, 13:56
Hi again! I'm having problems when i put files in the server with QFTP, the file is upload with no problem but when i want to show the transfer progress the signal datatransferprogress send a wrong value in the qint done... the first value that this signal send is 0 and the totalsize of the file and the second send the totalsize and the totasize... in 1 second this signal think that has send all the data when it is not like this.
void principal::loadFtp()
{
ftp = new QFtp;
ftp->connectToHost(dirHost);
ftp->login(hostUser,hostPass);
ftp->cd("public_html");
ftp->list();
ftp->setTransferMode(QFtp::Active);
connect(ftp,SIGNAL(dataTransferProgress(qint64,qin t64)),this,SLOT(ftpProgress(qint64,qint64)));
connect(ftp,SIGNAL(stateChanged(int)),this,SLOT(ft pStateChanged(int)));
connect(ftp,SIGNAL(commandStarted(int)),this,SLOT( ftpStart(int)));
connect(ftp,SIGNAL(commandFinished(int,bool)),this ,SLOT(ftpFinish(int,bool)));
connect(ftp,SIGNAL(listInfo(QUrlInfo)),this,SLOT(s howList(QUrlInfo)));
}
void principal::ftpProgress(qint64 done,qint64 total)
{
ui->ftpBar->setMaximum(total);
ui->ftpBar->setValue(done);
}
void principal::loadFtp()
{
ftp = new QFtp;
ftp->connectToHost(dirHost);
ftp->login(hostUser,hostPass);
ftp->cd("public_html");
ftp->list();
ftp->setTransferMode(QFtp::Active);
connect(ftp,SIGNAL(dataTransferProgress(qint64,qin t64)),this,SLOT(ftpProgress(qint64,qint64)));
connect(ftp,SIGNAL(stateChanged(int)),this,SLOT(ft pStateChanged(int)));
connect(ftp,SIGNAL(commandStarted(int)),this,SLOT( ftpStart(int)));
connect(ftp,SIGNAL(commandFinished(int,bool)),this ,SLOT(ftpFinish(int,bool)));
connect(ftp,SIGNAL(listInfo(QUrlInfo)),this,SLOT(s howList(QUrlInfo)));
}
void principal::ftpProgress(qint64 done,qint64 total)
{
ui->ftpBar->setMaximum(total);
ui->ftpBar->setValue(done);
}