void PartialArchive::emitStatusEvents() { updatePeerInfo(); updateDownloadRate(downloadRate); emit progressUpdated(torrentClient != 0 ? torrentClient->progress() : -1); emit statusTextUpdated(torrentClient != 0 ? getStateText(torrentClient->state()) : ""); }
} } //Create a new downloader Downloader *downloader = new Downloader(this); downloader->setLocalFileName(fileName); downloader->setLocalDirectory(DownDir); downloader->setThreadNum(threadNUM); // Setup the downlader connections connect(downloader, SIGNAL(stateChanged(QString)), this, SLOT(updateState(QString))); connect(downloader, SIGNAL(set_GuiProgressBarValue(int)), this, SLOT(updateProgress(int))); connect(downloader, SIGNAL(set_GuiLabelSpeed(QString)), this, SLOT(updateDownloadRate(QString))); connect(downloader, SIGNAL(set_GuiLabelDownloaded(QString)), this, SLOT(updateDownloaded(QString))); connect(downloader, SIGNAL(set_GuiLabelRemainingTime(QString)), this, SLOT(updateRemainingTime(QString))); // Add the downloader to the list of downloading jobs. Job job; job.downloader = downloader; job.fileName = fileName; job.destinationDir = DownDir; jobs << job; // Create and add a row in the job view for this download. QTreeWidgetItem *item = new QTreeWidgetItem(jobView);