| 55 | } |
| 56 | |
| 57 | void Technic::SingleZipPackInstallTask::downloadSucceeded() |
| 58 | { |
| 59 | m_abortable = false; |
| 60 | |
| 61 | setStatus(tr("Extracting modpack")); |
| 62 | QDir extractDir(FS::PathCombine(m_stagingPath, ".minecraft")); |
| 63 | qDebug() << "Attempting to create instance from" << m_archivePath; |
| 64 | |
| 65 | // open the zip and find relevant files in it |
| 66 | m_packZip.reset(new QuaZip(m_archivePath)); |
| 67 | if (!m_packZip->open(QuaZip::mdUnzip)) |
| 68 | { |
| 69 | emitFailed(tr("Unable to open supplied modpack zip file.")); |
| 70 | return; |
| 71 | } |
| 72 | m_extractFuture = QtConcurrent::run(QThreadPool::globalInstance(), MMCZip::extractSubDir, m_packZip.get(), QString(""), extractDir.absolutePath()); |
| 73 | connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &Technic::SingleZipPackInstallTask::extractFinished); |
| 74 | connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::canceled, this, &Technic::SingleZipPackInstallTask::extractAborted); |
| 75 | m_extractFutureWatcher.setFuture(m_extractFuture); |
| 76 | m_filesNetJob.reset(); |
| 77 | } |
| 78 | |
| 79 | void Technic::SingleZipPackInstallTask::downloadFailed(QString reason) |
| 80 | { |