void principal::loadFtp()
{
ftp->connectToHost(dirHost);
ftp->login(hostUser,hostPass);
ftp->cd("public_html");
ftp->list();
ftp
->setTransferMode
(QFtp::Active);
connect(ftp,SIGNAL(dataTransferProgress(qint64,qint64)),this,SLOT(ftpProgress(qint64,qint64)));
connect(ftp,SIGNAL(stateChanged(int)),this,SLOT(ftpStateChanged(int)));
connect(ftp,SIGNAL(commandStarted(int)),this,SLOT(ftpStart(int)));
connect(ftp,SIGNAL(commandFinished(int,bool)),this,SLOT(ftpFinish(int,bool)));
}
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,qint64)),this,SLOT(ftpProgress(qint64,qint64)));
connect(ftp,SIGNAL(stateChanged(int)),this,SLOT(ftpStateChanged(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(showList(QUrlInfo)));
}
To copy to clipboard, switch view to plain text mode
void principal::ftpProgress(qint64 done,qint64 total)
{
ui->ftpBar->setMaximum(total);
ui->ftpBar->setValue(done);
}
void principal::ftpProgress(qint64 done,qint64 total)
{
ui->ftpBar->setMaximum(total);
ui->ftpBar->setValue(done);
}
To copy to clipboard, switch view to plain text mode
Bookmarks