summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-04-22 10:52:15 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-04-26 07:06:35 +0000
commit3660ca50d05802a1f03c2c7f1ba7c1e873c01f78 (patch)
tree13b805edbe72e2fa5ae95620b89cdc71164d7470 /src/libs
parentf05ec1bcd90bfb168cef039f319ab79bdbfa0b5b (diff)
Do not try to remove non-existing package information file on rollback
The installation information XML file (components.xml by default) is not yet written to disk when downloading archives. Canceling the installation here would try to remove the not-yet-created file unconditionally. Task-number: QTIFW-2213 Change-Id: I922ffd7d1344755ed7fcf3f02e83bc02e789cd17 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/packagemanagercore.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 5b36f8bc6..6682bde7c 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -896,11 +896,10 @@ void PackageManagerCore::rollBackInstallation()
}
d->m_localPackageHub->writeToDisk();
- if (isInstaller()) {
- if (d->m_localPackageHub->packageInfoCount() == 0) {
- QFile file(d->m_localPackageHub->fileName());
+ if (isInstaller() && d->m_localPackageHub->packageInfoCount() == 0) {
+ QFile file(d->m_localPackageHub->fileName());
+ if (!file.fileName().isEmpty() && file.exists())
file.remove();
- }
}
if (becameAdmin)