PathChooser: Fix Windows.

Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Friedemann Kleint
2010-09-29 12:03:14 +02:00
parent 588bc1f78c
commit 6fabd1b237

View File

@@ -110,7 +110,9 @@ QString PathChooserPrivate::expandedPath(const QString &input) const
{ {
if (input.isEmpty()) if (input.isEmpty())
return input; return input;
const QString path = QDir::fromNativeSeparators(m_environment.expandVariables(input)); // Environment does \-expansion, too.
const QString nativeInput = QDir::fromNativeSeparators(input);
const QString path = QDir::fromNativeSeparators(m_environment.expandVariables(nativeInput));
if (path.isEmpty()) if (path.isEmpty())
return path; return path;
@@ -289,8 +291,6 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage)
//: Selected path is not valid: //: Selected path is not valid:
displayPath = tr("<not valid>"); displayPath = tr("<not valid>");
*errorMessage = tr("Full path: <b>%1</b>").arg(QDir::toNativeSeparators(expandedPath));
if (expandedPath.isEmpty()) { if (expandedPath.isEmpty()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The path must not be empty."); *errorMessage = tr("The path must not be empty.");
@@ -350,7 +350,8 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage)
default: default:
; ;
} }
if (errorMessage)
*errorMessage = tr("Full path: <b>%1</b>").arg(QDir::toNativeSeparators(expandedPath));
return true; return true;
} }