diff options
| author | Tom Tanner <thosrtanner2@users.sourceforge.net> | 2015-08-30 13:36:11 +0100 |
|---|---|---|
| committer | Tom Tanner <thosrtanner2@users.sourceforge.net> | 2015-08-30 13:36:11 +0100 |
| commit | 0c3c822d77425da812d8708d68466ac05bb198db (patch) | |
| tree | 51435247e80e24cd79c4f96305385082f855bad2 /src | |
| parent | f0ee9c3e4d90ba961d672862ccc28c44b835aa54 (diff) | |
Stop the temp files to delete list growing on each install
Diffstat (limited to 'src')
| -rw-r--r-- | src/installationmanager.cpp | 6 | ||||
| -rw-r--r-- | src/installationmanager.h | 2 |
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:
|
