summaryrefslogtreecommitdiffstats
path: root/src/sdk
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdk')
-rw-r--r--src/sdk/installerbasecommons.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sdk/installerbasecommons.cpp b/src/sdk/installerbasecommons.cpp
index 14c2c57ae..9e8b8ab12 100644
--- a/src/sdk/installerbasecommons.cpp
+++ b/src/sdk/installerbasecommons.cpp
@@ -372,14 +372,18 @@ QString TargetDirectoryPageImpl::targetDirWarning() const
}
QString dir = targetDir();
+ QString ambiguousChars = QLatin1String("[<>|?*!@#$%^&:,; ]");
+ if (packageManagerCore()->settings().allowSpaceInPath())
+ ambiguousChars.remove(QLatin1Char(' '));
+
#ifdef Q_OS_WIN
// remove e.g. "c:"
dir = dir.mid(2);
#endif
// check if there are not allowed characters in the target path
- if (dir.contains(QRegExp(QLatin1String("[!@#$%^&*: ,;]")))) {
- return TargetDirectoryPageImpl::tr("The installation path must not contain !@#$%^&*:,; or spaces, "
- "please specify a valid folder.");
+ if (dir.contains(QRegExp(ambiguousChars))) {
+ return TargetDirectoryPageImpl::tr("The installation path must not contain %1, "
+ "please specify a valid folder.").arg(ambiguousChars);
}
return QString();