Commit 9c2a7c7c authored by hjk's avatar hjk

TextEditor: Use direct interface for registerMimeTypeForLanguageId

Change-Id: I6984173acf86e80175f9e2346315b5b226d6bde9
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 0479abdc
......@@ -221,18 +221,10 @@ CppToolsSettings::CppToolsSettings(QObject *parent)
// mimetypes to be handled
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::C_SOURCE_MIMETYPE),
Constants::CPP_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::C_HEADER_MIMETYPE),
Constants::CPP_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::CPP_SOURCE_MIMETYPE),
Constants::CPP_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::CPP_HEADER_MIMETYPE),
Constants::CPP_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::C_SOURCE_MIMETYPE, Constants::CPP_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::C_HEADER_MIMETYPE, Constants::CPP_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::CPP_SOURCE_MIMETYPE, Constants::CPP_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::CPP_HEADER_MIMETYPE, Constants::CPP_SETTINGS_ID);
}
CppToolsSettings::~CppToolsSettings()
......
......@@ -134,24 +134,12 @@ QmlJSToolsSettings::QmlJSToolsSettings(QObject *parent)
}
// mimetypes to be handled
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::QML_MIMETYPE),
Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::QBS_MIMETYPE),
Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::QMLPROJECT_MIMETYPE),
Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::QMLTYPES_MIMETYPE),
Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::JS_MIMETYPE),
Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(
QLatin1String(Constants::JSON_MIMETYPE),
Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::QML_MIMETYPE, Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::QBS_MIMETYPE, Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::QMLPROJECT_MIMETYPE, Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::QMLTYPES_MIMETYPE, Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::JS_MIMETYPE, Constants::QML_JS_SETTINGS_ID);
TextEditorSettings::registerMimeTypeForLanguageId(Constants::JSON_MIMETYPE, Constants::QML_JS_SETTINGS_ID);
}
QmlJSToolsSettings::~QmlJSToolsSettings()
......
......@@ -479,9 +479,9 @@ void TextEditorSettings::unregisterCodeStylePool(Core::Id languageId)
d->m_languageToCodeStylePool.remove(languageId);
}
void TextEditorSettings::registerMimeTypeForLanguageId(const QString &mimeType, Core::Id languageId)
void TextEditorSettings::registerMimeTypeForLanguageId(const char *mimeType, Core::Id languageId)
{
d->m_mimeTypeToLanguage.insert(mimeType, languageId);
d->m_mimeTypeToLanguage.insert(QString::fromLatin1(mimeType), languageId);
}
Core::Id TextEditorSettings::languageId(const QString &mimeType)
......
......@@ -101,7 +101,7 @@ public:
static void registerCodeStyle(Core::Id languageId, ICodeStylePreferences *prefs);
static void unregisterCodeStyle(Core::Id languageId);
static void registerMimeTypeForLanguageId(const QString &mimeType, Core::Id languageId);
static void registerMimeTypeForLanguageId(const char *mimeType, Core::Id languageId);
static Core::Id languageId(const QString &mimeType);
signals:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment