summaryrefslogtreecommitdiff
path: root/src/installationmanager.cpp
diff options
context:
space:
mode:
authorKrzysztof Starecki <krzysztof.starecki@gmail.com>2019-02-20 15:20:20 +0100
committerKrzysztof Starecki <krzysztof.starecki@gmail.com>2019-02-20 15:20:20 +0100
commit067d605a58004b2dbde4b0951844baf11c409497 (patch)
treed106d89fd4f06224d313a113b229b97b49ee2146 /src/installationmanager.cpp
parent51c02718b1eaf2c8680e951d913baceb703bb74a (diff)
Fix state breakage when terminating installation via exceptions
Diffstat (limited to 'src/installationmanager.cpp')
-rw-r--r--src/installationmanager.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp
index b11f5667..e443a8f2 100644
--- a/src/installationmanager.cpp
+++ b/src/installationmanager.cpp
@@ -713,6 +713,8 @@ bool InstallationManager::install(const QString &fileName,
int modID)
{
m_IsRunning = true;
+ ON_BLOCK_EXIT([this]() { m_IsRunning = false; });
+
QFileInfo fileInfo(fileName);
if (m_SupportedExtensions.find(fileInfo.suffix()) == m_SupportedExtensions.end()) {
reportError(tr("File format \"%1\" not supported").arg(fileInfo.suffix()));
@@ -863,7 +865,6 @@ bool InstallationManager::install(const QString &fileName,
switch (installResult) {
case IPluginInstaller::RESULT_CANCELED:
case IPluginInstaller::RESULT_FAILED: {
- m_IsRunning = false;
return false;
} break;
case IPluginInstaller::RESULT_SUCCESS:
@@ -872,10 +873,8 @@ bool InstallationManager::install(const QString &fileName,
DirectoryTree::node_iterator iniTweakNode = filesTree->nodeFind(DirectoryTreeInformation("INI Tweaks"));
hasIniTweaks = (iniTweakNode != filesTree->nodesEnd()) &&
((*iniTweakNode)->numLeafs() != 0);
- m_IsRunning = false;
return true;
} else {
- m_IsRunning = false;
return false;
}
} break;
@@ -885,7 +884,6 @@ bool InstallationManager::install(const QString &fileName,
reportError(tr("None of the available installer plugins were able to handle that archive.\n"
"This is likely due to a corrupted or incompatible download or unrecognized archive format."));
- m_IsRunning = false;
return false;
}