From 0c3c822d77425da812d8708d68466ac05bb198db Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Sun, 30 Aug 2015 13:36:11 +0100 Subject: Stop the temp files to delete list growing on each install --- src/installationmanager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/installationmanager.cpp') 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); -- cgit v1.3.1