Example #1
0
void WebPuppeteerTab::downloadFile(QNetworkReply*reply) {
	// Won't be finished at this point, need to connect() to reply signals to detect end of download
	// Just in case, check if reply->isFinished()
	if (reply->isFinished()) {
		downloadFileFinished(reply);
	}
	connect(reply, SIGNAL(finished()), this, SLOT(downloadFileFinished()));
}
void DownloadFileThread::run()
{
    GlobalXAgentOCX *agentOCX = GlobalXAgentOCX::instance();
    this->m_result = agentOCX->downloadFile(m_serverFileName);
    this->msleep(1000);
    emit downloadFileFinished(m_fileType, m_result);
}
void OnlineDataManager::downloadFileFinished()
{
    OnlineDataNode *dataNode = qobject_cast<OnlineDataNode *>(sender());
    emit downloadFileFinished(dataNode->id());
}
void OnlineDataManager::beginDownloadFile(QString nodePath, QString actionId) {

    OnlineDataNode *dataNode = downloadFileAsync(nodePath, actionId);
    _actionNodes[actionId] = dataNode;
    connect(dataNode, SIGNAL(finished()), this, SLOT(downloadFileFinished()));
}