Commit bb408662 authored by Ulf Hermann's avatar Ulf Hermann

Beautifier: Move initialization to extensionsInitialized()

Beautifier makes heavy use of mime types which shouldn't be accessed
in initialize() as that doubles the overhead for parsing them.

Change-Id: Ie731f1194f281e9574ef914d67537651658ea9e7
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 608f6473
......@@ -196,7 +196,11 @@ bool BeautifierPlugin::initialize(const QStringList &arguments, QString *errorSt
menu->menu()->setTitle(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY));
menu->setOnAllDisabledBehavior(Core::ActionContainer::Show);
Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu);
return true;
}
void BeautifierPlugin::extensionsInitialized()
{
m_tools << new ArtisticStyle::ArtisticStyle(this);
m_tools << new ClangFormat::ClangFormat(this);
m_tools << new Uncrustify::Uncrustify(this);
......@@ -216,11 +220,7 @@ bool BeautifierPlugin::initialize(const QStringList &arguments, QString *errorSt
addAutoReleasedObject(settingsPage);
updateActions();
return true;
}
void BeautifierPlugin::extensionsInitialized()
{
const Core::EditorManager *editorManager = Core::EditorManager::instance();
connect(editorManager, &Core::EditorManager::currentEditorChanged,
this, &BeautifierPlugin::updateActions);
......
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