forked from qt-creator/qt-creator
Register python editors icon overlay in extensionsInitialized()
Requesting mime types in initialized() is expensive because it causes the mime database to be parsed. As additional mime types are added on various plugin initializations, the database will be reparsed later anyway. It's better to request the mime types afterwards. Change-Id: I6c5f67a4483a693b2f69beb300b8014522fa2678 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -905,13 +905,16 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
|
||||
addAutoReleasedObject(new PythonRunConfigurationFactory);
|
||||
addAutoReleasedObject(new PythonRunControlFactory);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void PythonEditorPlugin::extensionsInitialized()
|
||||
{
|
||||
// Initialize editor actions handler
|
||||
// Add MIME overlay icons (these icons displayed at Project dock panel)
|
||||
const QIcon icon = QIcon::fromTheme(C_PY_MIME_ICON);
|
||||
if (!icon.isNull())
|
||||
Core::FileIconProvider::registerIconOverlayForMimeType(icon, C_PY_MIMETYPE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
~PythonEditorPlugin() override;
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage) override;
|
||||
void extensionsInitialized() override {}
|
||||
void extensionsInitialized() override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user