forked from qt-creator/qt-creator
QmlJsEditor: Delay the call of registerIconOverlayForMimeType
Calling FileIconProvider::registerIconOverlayForMimeType during plugin
construction caused the warning:
Accessing MimeDatabase for application/x-qt.ui+qml before plugins are
initialized
Better register it in extensionsInitialized.
Amends: 613a9a13c8
Change-Id: I08ebcad461019464dec04954aa8b436d96f503cc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -211,8 +211,6 @@ QmlJSEditorPluginPrivate::QmlJSEditorPluginPrivate()
|
||||
contextMenu->addAction(cmd);
|
||||
|
||||
FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_QML, "qml");
|
||||
FileIconProvider::registerIconOverlayForMimeType(ProjectExplorer::Constants::FILEOVERLAY_UI,
|
||||
"application/x-qt.ui+qml");
|
||||
|
||||
connect(EditorManager::instance(), &EditorManager::currentEditorChanged,
|
||||
this, &QmlJSEditorPluginPrivate::currentEditorChanged);
|
||||
@@ -223,6 +221,9 @@ QmlJSEditorPluginPrivate::QmlJSEditorPluginPrivate()
|
||||
|
||||
void QmlJSEditorPlugin::extensionsInitialized()
|
||||
{
|
||||
FileIconProvider::registerIconOverlayForMimeType(ProjectExplorer::Constants::FILEOVERLAY_UI,
|
||||
"application/x-qt.ui+qml");
|
||||
|
||||
TaskHub::addCategory(Constants::TASK_CATEGORY_QML, tr("QML"));
|
||||
TaskHub::addCategory(Constants::TASK_CATEGORY_QML_ANALYSIS, tr("QML Analysis"), false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user