From 5a266b8e268163f3f25063aa823dd1fc72ee7c56 Mon Sep 17 00:00:00 2001 From: Silarn Date: Wed, 11 Dec 2019 12:06:36 -0600 Subject: When cancelling a fomod extraction, don't generate an error. --- src/installationmanager.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/installationmanager.cpp') diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index dd5cfb55..8ea2bac7 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -307,7 +307,16 @@ QStringList InstallationManager::extractFiles(const QStringList &filesOrig, bool QCoreApplication::processEvents(); } while (!future.isFinished() || m_InstallationProgress->isVisible()); if (!future.result()) { - throw MyException(tr("Extraction failed: %1").arg(m_ArchiveHandler->getLastError())); + if (m_ArchiveHandler->getLastError() == Archive::ERROR_EXTRACT_CANCELLED) { + if (!m_ErrorMessage.isEmpty()) { + throw MyException(tr("Extraction failed: %1").arg(m_ErrorMessage)); + } else { + return QStringList(); + } + } + else { + throw MyException(tr("Extraction failed: %1").arg(m_ArchiveHandler->getLastError())); + } } return result; @@ -839,7 +848,7 @@ bool InstallationManager::install(const QString &fileName, } } - { // custom case + if (installResult != IPluginInstaller::RESULT_CANCELED) { // custom case IPluginInstallerCustom *installerCustom = dynamic_cast(installer); if ((installerCustom != nullptr) -- cgit v1.3.1