| 280 | } |
| 281 | |
| 282 | void Download::downloadReadyRead() |
| 283 | { |
| 284 | if (m_state == State::Running) { |
| 285 | auto data = m_reply->readAll(); |
| 286 | m_state = m_sink->write(data); |
| 287 | if (m_state == State::Failed) { |
| 288 | qCritical() << "Failed to process response chunk"; |
| 289 | } |
| 290 | // qDebug() << "Download" << m_url.toString() << "gained" << data.size() << "bytes"; |
| 291 | } else { |
| 292 | qCritical() << "Cannot write download data! illegal status " << m_status; |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | } // namespace Net |
| 297 |