summaryrefslogtreecommitdiffstats
path: root/src/libs/installer
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-12-02 17:34:27 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-12-03 13:43:35 +0200
commiteca91dcdca76fbde8050629631f06518109f9d02 (patch)
treeddc05c8ee20165259653b9ff490d11db5fd8ce1e /src/libs/installer
parenta31c37e7fc3416d6627d1d13377506147d6ecd81 (diff)
Fix "Empty filename passed to function" warning on target directory page
When verifying the selected target directory for forbidden directories (user home and root), we incorrectly checked if the directory was empty regardless of if the path of the QDir object was empty. No need to check this as installing into either of these should be prevented - the folder may be populated after initial installation and installer would then nuke it on uninstallation. Also fix related warning about deprecated '=' operator. Task-number: QTIFW-2424 Change-Id: If4835dcc719e09e0a51a13149ae05d75c0e2b359 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer')
-rw-r--r--src/libs/installer/packagemanagercore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 311ac544d..9d594b2eb 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -1103,8 +1103,8 @@ QString PackageManagerCore::targetDirWarning(const QString &targetDirectory) con
}
}
- target = target.canonicalPath();
- if (!target.isEmpty() && (target == QDir::root() || target == QDir::home())) {
+ target.setPath(target.canonicalPath());
+ if (!target.path().isEmpty() && (target == QDir::root() || target == QDir::home())) {
return tr("As the install directory is completely deleted, installing in %1 is forbidden.")
.arg(QDir::toNativeSeparators(target.path()));
}