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 <QGraphicsOpacityEffect>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
#include <utils/winutils.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
debug = false
|
debug = false
|
||||||
};
|
};
|
||||||
@@ -82,6 +86,16 @@ const int collapseButtonOffset = 114;
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
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
|
#ifdef Q_OS_MAC
|
||||||
# define SHARE_PATH "/../Resources/qmldesigner"
|
# define SHARE_PATH "/../Resources/qmldesigner"
|
||||||
#else
|
#else
|
||||||
@@ -90,7 +104,7 @@ namespace QmlDesigner {
|
|||||||
|
|
||||||
static inline QString sharedDirPath()
|
static inline QString sharedDirPath()
|
||||||
{
|
{
|
||||||
QString appPath = QCoreApplication::applicationDirPath();
|
QString appPath = applicationDirPath();
|
||||||
|
|
||||||
return QFileInfo(appPath + SHARE_PATH).absoluteFilePath();
|
return QFileInfo(appPath + SHARE_PATH).absoluteFilePath();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user