diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2019-02-21 03:30:24 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-21 03:30:24 -0600 |
| commit | 78be0744f9ed7ed5bda386d640b704da565bccbe (patch) | |
| tree | 20abe91745aedebbc44566dfec0e79f25b676896 /src/installationmanager.cpp | |
| parent | 330ff910d16c381157afa7aae744dc160abb250d (diff) | |
| parent | 067d605a58004b2dbde4b0951844baf11c409497 (diff) | |
Merge pull request #661 from przester/double-install-fix
Fix state breakage when terminating installation via exceptions
Diffstat (limited to 'src/installationmanager.cpp')
| -rw-r--r-- | src/installationmanager.cpp | 6 |
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; } |
