summaryrefslogtreecommitdiff
path: root/src/installationmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/installationmanager.cpp')
-rw-r--r--src/installationmanager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp
index 64e58358..76b1e086 100644
--- a/src/installationmanager.cpp
+++ b/src/installationmanager.cpp
@@ -677,7 +677,14 @@ void InstallationManager::postInstallCleanup()
// TODO: this doesn't yet remove directories. Also, the files may be left there if this point isn't reached
for (const QString &tempFile : m_TempFilesToDelete) {
QFileInfo fileInfo(QDir::tempPath() + "/" + tempFile);
- QFile::remove(fileInfo.absoluteFilePath());
+ if (fileInfo.exists()) {
+ if (!fileInfo.isReadable() || !fileInfo.isWritable()) {
+ QFile::setPermissions(fileInfo.absoluteFilePath(), QFile::ReadOther | QFile::WriteOther);
+ }
+ if (!QFile::remove(fileInfo.absoluteFilePath())) {
+ qWarning() << "Unable to delete " << fileInfo.absoluteFilePath();
+ }
+ }
directoriesToRemove.insert(fileInfo.absolutePath());
}