summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-01-29 10:42:04 +0100
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-01-29 11:12:13 +0100
commit80ceccff00a46ecd37ed2c65784cb5905d067526 (patch)
treed11fcc9d806d9c6cebd3b2a05c9c8925d14db984 /src
parenta9af153f52a2b0be14096a458a0cb56a1b87cd3a (diff)
Check for non-ASCII characters earlier, we do related stuff there as well.
Change-Id: I89fbd0d16c85636c9abc571dce77fb4e9c2c0add Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/sdk/installerbasecommons.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/sdk/installerbasecommons.cpp b/src/sdk/installerbasecommons.cpp
index a4a1ce3cb..75bcd2eed 100644
--- a/src/sdk/installerbasecommons.cpp
+++ b/src/sdk/installerbasecommons.cpp
@@ -402,6 +402,17 @@ QString TargetDirectoryPageImpl::targetDirWarning() const
"please specify a valid folder.").arg(ambiguousChars);
}
+ dir = targetDir();
+ if (!packageManagerCore()->settings().allowNonAsciiCharacters()) {
+ for (int i = 0; i < dir.length(); ++i) {
+ if (dir.at(i).unicode() & 0xff80) {
+ return TargetDirectoryPageImpl::tr("The path or installation directory contains non ASCII "
+ "characters. This is currently not supported! Please choose a different path or "
+ "installation directory.");
+ }
+ }
+ }
+
return QString();
}
@@ -440,16 +451,6 @@ bool TargetDirectoryPageImpl::validatePage()
return true;
const QString targetDir = this->targetDir();
- if (!packageManagerCore()->settings().allowNonAsciiCharacters()) {
- for (int i = 0; i < targetDir.length(); ++i) {
- if (targetDir.at(i).unicode() & 0xff80) {
- return failWithError(QLatin1String("NonAsciiTarget"), tr("The path or installation directory "
- "contains non ASCII characters. This is currently not supported! Please choose a different "
- "path or installation directory."));
- }
- }
- }
-
const QDir dir(targetDir);
// the directory exists and is empty...
if (dir.exists() && dir.entryList(QDir::AllEntries | QDir::NoDotAndDotDot).isEmpty())