From 274c93b4a05967563f0b201ff0b6faf9b6292701 Mon Sep 17 00:00:00 2001 From: kh1 Date: Thu, 8 Nov 2012 16:49:59 +0100 Subject: Add some more ambiguous chars and option to allow space. Task-number: QTIFW-148 Task-number: QTIFW-161 Change-Id: I20a0a1be872807305398d81b8672f3df77220212 Reviewed-by: Tim Jenssen Reviewed-by: Leena Miettinen Reviewed-by: Niels Weber --- src/sdk/installerbasecommons.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/sdk') 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(); -- cgit v1.2.3