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:
Ulf Hermann
2016-11-07 18:42:19 +01:00
parent de687f5f9e
commit 608f647374
2 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -40,7 +40,7 @@ public:
~PythonEditorPlugin() override;
bool initialize(const QStringList &arguments, QString *errorMessage) override;
void extensionsInitialized() override {}
void extensionsInitialized() override;
};
} // namespace Internal