summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/installationmanager.cpp6
-rw-r--r--src/installationmanager.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp
index 71b38139..0f66a7e8 100644
--- a/src/installationmanager.cpp
+++ b/src/installationmanager.cpp
@@ -591,7 +591,7 @@ bool InstallationManager::wasCancelled()
}
-void InstallationManager::postInstallCleanup() const
+void InstallationManager::postInstallCleanup()
{
m_CurrentArchive->close();
@@ -605,12 +605,14 @@ void InstallationManager::postInstallCleanup() const
// clean up temp files
// TODO: this doesn't yet remove directories. Also, the files may be left there if this point isn't reached
- foreach (const QString &tempFile, m_TempFilesToDelete) {
+ for (const QString &tempFile : m_TempFilesToDelete) {
QFileInfo fileInfo(QDir::tempPath() + "/" + tempFile);
QFile::remove(fileInfo.absoluteFilePath());
directoriesToRemove.insert(fileInfo.absolutePath());
}
+ m_TempFilesToDelete.clear();
+
// try to delete each directory we had temporary files in. the call fails for non-empty directories which is ok
foreach (const QString &dir, directoriesToRemove) {
QDir().rmdir(dir);
diff --git a/src/installationmanager.h b/src/installationmanager.h
index f6028904..d4b4f7dc 100644
--- a/src/installationmanager.h
+++ b/src/installationmanager.h
@@ -177,7 +177,7 @@ private:
bool ensureValidModName(MOBase::GuessedValue<QString> &name) const;
- void postInstallCleanup() const;
+ void postInstallCleanup();
private: