From 2000491108a333f00a114edd00439b5359b8db2d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 14 Dec 2021 10:45:52 +0100 Subject: [PATCH] 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: 613a9a13c83f07b6809415fc6ed3a50ea27186e8 Change-Id: I08ebcad461019464dec04954aa8b436d96f503cc Reviewed-by: Eike Ziller --- src/plugins/qmljseditor/qmljseditorplugin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index 62ee3d0f9be..fea27341a25 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -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); }