| 854 | } |
| 855 | |
| 856 | void PackInstallTask::onModsDownloaded() { |
| 857 | abortable = false; |
| 858 | |
| 859 | qDebug() << "PackInstallTask::onModsDownloaded: " << QThread::currentThreadId(); |
| 860 | jobPtr.reset(); |
| 861 | |
| 862 | if(!modsToExtract.empty() || !modsToDecomp.empty() || !modsToCopy.empty()) { |
| 863 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 864 | m_modExtractFuture = QtConcurrent::run(QThreadPool::globalInstance(), &PackInstallTask::extractMods, this, modsToExtract, modsToDecomp, modsToCopy); |
| 865 | #else |
| 866 | m_modExtractFuture = QtConcurrent::run(QThreadPool::globalInstance(), this, &PackInstallTask::extractMods, modsToExtract, modsToDecomp, modsToCopy); |
| 867 | #endif |
| 868 | connect(&m_modExtractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &PackInstallTask::onModsExtracted); |
| 869 | connect(&m_modExtractFutureWatcher, &QFutureWatcher<QStringList>::canceled, this, [&]() |
| 870 | { |
| 871 | emitAborted(); |
| 872 | }); |
| 873 | m_modExtractFutureWatcher.setFuture(m_modExtractFuture); |
| 874 | } |
| 875 | else { |
| 876 | install(); |
| 877 | } |
| 878 | } |
| 879 | |
| 880 | void PackInstallTask::onModsExtracted() { |
| 881 | qDebug() << "PackInstallTask::onModsExtracted: " << QThread::currentThreadId(); |