| 117 | } |
| 118 | |
| 119 | void Technic::SolderPackInstallTask::downloadSucceeded() |
| 120 | { |
| 121 | m_abortable = false; |
| 122 | |
| 123 | setStatus(tr("Extracting modpack")); |
| 124 | m_filesNetJob.reset(); |
| 125 | m_extractFuture = QtConcurrent::run([this]() |
| 126 | { |
| 127 | int i = 0; |
| 128 | QString extractDir = FS::PathCombine(m_stagingPath, ".minecraft"); |
| 129 | FS::ensureFolderPathExists(extractDir); |
| 130 | |
| 131 | while (m_modCount > i) |
| 132 | { |
| 133 | auto path = FS::PathCombine(m_outputDir.path(), QString("%1").arg(i)); |
| 134 | if (!MMCZip::extractDir(path, extractDir)) |
| 135 | { |
| 136 | return false; |
| 137 | } |
| 138 | i++; |
| 139 | } |
| 140 | return true; |
| 141 | }); |
| 142 | connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &Technic::SolderPackInstallTask::extractFinished); |
| 143 | connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::canceled, this, &Technic::SolderPackInstallTask::extractAborted); |
| 144 | m_extractFutureWatcher.setFuture(m_extractFuture); |
| 145 | } |
| 146 | |
| 147 | void Technic::SolderPackInstallTask::downloadFailed(QString reason) |
| 148 | { |
nothing calls this directly
no test coverage detected