From 3818efae0317975c6aca4425d7b0528df51673cc Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 29 Nov 2012 11:42:10 +0100 Subject: [PATCH] QmlDesigner.PropertyEditor: normalize applicationDirPath() This is needed on Windows for QML since QML always checks for capitalization. Task-number: QTCREATORBUG-6126 Task-number: QTBUG-28230 Change-Id: I011464288f6052bfe19452b8ce555d6c462e15dd Reviewed-by: Eike Ziller --- .../components/propertyeditor/propertyeditor.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp index cd4cb48d88a..2fb862aea6f 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp @@ -74,6 +74,10 @@ #include #include +#ifdef Q_OS_WIN +#include +#endif + enum { debug = false }; @@ -82,6 +86,16 @@ const int collapseButtonOffset = 114; namespace QmlDesigner { +static QString applicationDirPath() +{ +#ifdef Q_OS_WIN + // normalize paths so QML doesn't freak out if it's wrongly capitalized on Windows + return Utils::normalizePathName(QCoreApplication::applicationDirPath()); +#else + return QCoreApplication::applicationDirPath(); +#endif +} + #ifdef Q_OS_MAC # define SHARE_PATH "/../Resources/qmldesigner" #else @@ -90,7 +104,7 @@ namespace QmlDesigner { static inline QString sharedDirPath() { - QString appPath = QCoreApplication::applicationDirPath(); + QString appPath = applicationDirPath(); return QFileInfo(appPath + SHARE_PATH).absoluteFilePath(); }