forked from qt-creator/qt-creator
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 <eike.ziller@digia.com>
This commit is contained in:
@@ -74,6 +74,10 @@
|
||||
#include <QGraphicsOpacityEffect>
|
||||
#include <QToolBar>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <utils/winutils.h>
|
||||
#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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user