From c0d86751dd0b44525208541e03cd485cdcb82005 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 8 Jul 2024 12:50:31 +0200 Subject: [PATCH] Welcome: Use ActionBuilder to set up the UI Tour action Change-Id: I6b7590d7923da7dc5cd92c59a678fe031f6752c6 Reviewed-by: Christian Stenger --- src/plugins/welcome/welcomeplugin.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 9cc21213823..0a3c1b6b478 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -91,12 +91,10 @@ public: { m_welcomeMode = new WelcomeMode; - auto introAction = new QAction(Tr::tr("UI Tour"), this); - connect(introAction, &QAction::triggered, &runUiTour); - Command *cmd = ActionManager::registerAction(introAction, "Welcome.UITour"); - ActionContainer *mhelp = ActionManager::actionContainer(Core::Constants::M_HELP); - if (QTC_GUARD(mhelp)) - mhelp->addAction(cmd, Core::Constants::G_HELP_HELP); + ActionBuilder(this, "Welcome.UITour") + .setText(Tr::tr("UI Tour")) + .addToContainer(Core::Constants::M_HELP, Core::Constants::G_HELP_HELP, true) + .addOnTriggered(&runUiTour); if (!arguments.contains("-notour")) { connect(ICore::instance(), &ICore::coreOpened, this, [] { askUserAboutIntroduction(); },