| 133 | } |
| 134 | |
| 135 | void Technic::SolderPackInstallTask::downloadSucceeded() |
| 136 | { |
| 137 | m_abortable = false; |
| 138 | |
| 139 | setStatus(tr("Extracting modpack")); |
| 140 | m_filesNetJob.reset(); |
| 141 | m_extractFuture = QtConcurrent::run([this]() |
| 142 | { |
| 143 | int i = 0; |
| 144 | QString extractDir = FS::PathCombine(m_stagingPath, ".minecraft"); |
| 145 | FS::ensureFolderPathExists(extractDir); |
| 146 | |
| 147 | while (m_modCount > i) |
| 148 | { |
| 149 | auto path = FS::PathCombine(m_outputDir.path(), QString("%1").arg(i)); |
| 150 | if (!MMCZip::extractDir(path, extractDir)) |
| 151 | { |
| 152 | return false; |
| 153 | } |
| 154 | i++; |
| 155 | } |
| 156 | return true; |
| 157 | }); |
| 158 | connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &Technic::SolderPackInstallTask::extractFinished); |
| 159 | connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::canceled, this, &Technic::SolderPackInstallTask::extractAborted); |
| 160 | m_extractFutureWatcher.setFuture(m_extractFuture); |
| 161 | } |
| 162 | |
| 163 | void Technic::SolderPackInstallTask::downloadFailed(QString reason) |
| 164 | { |
nothing calls this directly
no test coverage detected