| 641 | } |
| 642 | |
| 643 | void PackInstallTask::onModsDownloaded() { |
| 644 | abortable = false; |
| 645 | |
| 646 | qDebug() << "PackInstallTask::onModsDownloaded: " << QThread::currentThreadId(); |
| 647 | jobPtr.reset(); |
| 648 | |
| 649 | if(!modsToExtract.empty() || !modsToDecomp.empty() || !modsToCopy.empty()) { |
| 650 | m_modExtractFuture = QtConcurrent::run(QThreadPool::globalInstance(), this, &PackInstallTask::extractMods, modsToExtract, modsToDecomp, modsToCopy); |
| 651 | connect(&m_modExtractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &PackInstallTask::onModsExtracted); |
| 652 | connect(&m_modExtractFutureWatcher, &QFutureWatcher<QStringList>::canceled, this, [&]() |
| 653 | { |
| 654 | emitAborted(); |
| 655 | }); |
| 656 | m_modExtractFutureWatcher.setFuture(m_modExtractFuture); |
| 657 | } |
| 658 | else { |
| 659 | install(); |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | void PackInstallTask::onModsExtracted() { |
| 664 | qDebug() << "PackInstallTask::onModsExtracted: " << QThread::currentThreadId(); |