| 60 | } |
| 61 | |
| 62 | void GzipDownloader::onArchiveReady() |
| 63 | { |
| 64 | if(!isActive()) { |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | if(networkReply->error() != QNetworkReply::NoError) |
| 69 | { |
| 70 | emit errorOccurred(networkReply->errorString()); |
| 71 | cleanup(); |
| 72 | } |
| 73 | else |
| 74 | { |
| 75 | auto dat = networkReply->readAll(); |
| 76 | downloadedFile.write(dat); |
| 77 | downloadedFile.close(); |
| 78 | |
| 79 | emit decompressionStarted(); |
| 80 | |
| 81 | extractThread = new ExtractionThread(extractionPath.path(), downloadedFile.fileName(), this); |
| 82 | connect(extractThread, &ExtractionThread::onFinished, this, &GzipDownloader::onArchiveExtracted); |
| 83 | extractThread->start(); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | void GzipDownloader::onArchiveExtracted(const QString &errorString) |
| 88 | { |