summaryrefslogtreecommitdiff
path: root/src/installationmanager.cpp
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2018-10-31 00:52:32 -0500
committerLostDragonist <lost.dragonist@gmail.com>2018-10-31 00:52:32 -0500
commit6056202ead2cb80bebf4b9b07bd418c1a000bce3 (patch)
treeb4505d7fc41992bdfc9e60bb36f590bd9fba6c4c /src/installationmanager.cpp
parentc1d90b131b72d4f756a70cd4b6faf766c9a11c82 (diff)
Fix crash when 7-zip fails to extract a file
A thread is spun off to handle the extraction while the main thread handles the progress bar updates. Previously, a dialog was spawned in the thread when an error in 7-zip occurred. Now, the thread will terminate and pass the error message back to the main thread who will spawn the dialog.
Diffstat (limited to 'src/installationmanager.cpp')
-rw-r--r--src/installationmanager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp
index 5c8b6897..64e58358 100644
--- a/src/installationmanager.cpp
+++ b/src/installationmanager.cpp
@@ -451,7 +451,7 @@ void InstallationManager::updateProgressFile(QString const &fileName)
void InstallationManager::report7ZipError(QString const &errorMessage)
{
- reportError(errorMessage);
+ m_ErrorMessage = errorMessage;
m_ArchiveHandler->cancel();
}
@@ -608,7 +608,11 @@ bool InstallationManager::doInstall(GuessedValue<QString> &modName, QString game
} while (!future.isFinished());
if (!future.result()) {
if (m_ArchiveHandler->getLastError() == Archive::ERROR_EXTRACT_CANCELLED) {
+ if (!m_ErrorMessage.isEmpty()) {
+ throw MyException(QString("extracting failed (%1)").arg(m_ErrorMessage));
+ } else {
return false;
+ }
} else {
throw MyException(QString("extracting failed (%1)").arg(m_ArchiveHandler->getLastError()));
}