void DroneshareAPIBroker::downloadProgress(qint64 bytesWritten, qint64 totalBytes) { if (m_httpRequestAborted) return; QLOG_DEBUG() << "DroneshareQuery: " << m_url << " :"<< bytesWritten << "/" << totalBytes; emit queryProgress(bytesWritten, totalBytes); }
// -------------------------------------------------------------------------- QUuid qMidasAPIPrivate::postQuery(const QUrl& url) { Q_Q(qMidasAPI); QNetworkRequest queryRequest; queryRequest.setUrl(url); QUuid queryUuid = QUuid::createUuid(); q->emit infoReceived("Post query: " + url.toString()); QNetworkReply* queryReply = this->NetworkManager->get(queryRequest); queryReply->setProperty("uuid", queryUuid.toString()); if (this->TimeOut > 0) { QTimer* timeOut = new QTimer(queryReply); timeOut->setSingleShot(true); QObject::connect(timeOut, SIGNAL(timeout()), this, SLOT(queryTimeOut())); timeOut->start(this->TimeOut); QObject::connect(queryReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(queryProgress())); } return queryUuid; }