From 80ceccff00a46ecd37ed2c65784cb5905d067526 Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 29 Jan 2013 10:42:04 +0100 Subject: Check for non-ASCII characters earlier, we do related stuff there as well. Change-Id: I89fbd0d16c85636c9abc571dce77fb4e9c2c0add Reviewed-by: Kai Koehne Reviewed-by: Niels Weber --- src/sdk/installerbasecommons.cpp | 21 +++++++++++---------- 1 file 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()) -- cgit v1.2.3