forked from qt-creator/qt-creator
Qmljs: small QHash improvements
Change-Id: I79a5504c8471b66540aac8047fbcf760ceb6b10f Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
@@ -139,14 +139,15 @@ ModelManagerInterface::~ModelManagerInterface()
|
||||
|
||||
static QHash<QString, Dialect> defaultLanguageMapping()
|
||||
{
|
||||
QHash<QString, Dialect> res;
|
||||
res[QLatin1String("js")] = Dialect::JavaScript;
|
||||
res[QLatin1String("qml")] = Dialect::Qml;
|
||||
res[QLatin1String("qmltypes")] = Dialect::QmlTypeInfo;
|
||||
res[QLatin1String("qmlproject")] = Dialect::QmlProject;
|
||||
res[QLatin1String("json")] = Dialect::Json;
|
||||
res[QLatin1String("qbs")] = Dialect::QmlQbs;
|
||||
res[QLatin1String(qtQuickUISuffix)] = Dialect::QmlQtQuick2Ui;
|
||||
static QHash<QString, Dialect> res{
|
||||
{QLatin1String("js"), Dialect::JavaScript},
|
||||
{QLatin1String("qml"), Dialect::Qml},
|
||||
{QLatin1String("qmltypes"), Dialect::QmlTypeInfo},
|
||||
{QLatin1String("qmlproject"), Dialect::QmlProject},
|
||||
{QLatin1String("json"), Dialect::Json},
|
||||
{QLatin1String("qbs"), Dialect::QmlQbs},
|
||||
{QLatin1String(qtQuickUISuffix), Dialect::QmlQtQuick2Ui}
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@@ -168,7 +168,8 @@ void setupProjectInfoQmlBundles(ModelManagerInterface::ProjectInfo &projectInfo)
|
||||
|
||||
namespace Internal {
|
||||
|
||||
QHash<QString,Dialect> ModelManager::languageForSuffix() const
|
||||
|
||||
QHash<QString,Dialect> ModelManager::initLanguageForSuffix() const
|
||||
{
|
||||
QHash<QString,Dialect> res = ModelManagerInterface::languageForSuffix();
|
||||
|
||||
@@ -196,6 +197,12 @@ QHash<QString,Dialect> ModelManager::languageForSuffix() const
|
||||
return res;
|
||||
}
|
||||
|
||||
QHash<QString,Dialect> ModelManager::languageForSuffix() const
|
||||
{
|
||||
static QHash<QString,Dialect> res = initLanguageForSuffix();
|
||||
return res;
|
||||
}
|
||||
|
||||
ModelManager::ModelManager(QObject *parent):
|
||||
ModelManagerInterface(parent)
|
||||
{
|
||||
|
@@ -60,6 +60,7 @@ private slots:
|
||||
void updateDefaultProjectInfo();
|
||||
private:
|
||||
void loadDefaultQmlTypeDescriptions();
|
||||
QHash<QString, QmlJS::Dialect> initLanguageForSuffix() const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user