Bazaar: Make create repository a global action

Also initialize text of parameter actions when defining the parameter action.
Avoids empty items if the setParameter() call is done too late.

Change-Id: I5e3398e5e537fc65f5c9c43cd62345b322f3143d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2023-11-15 14:39:28 +01:00
parent 35a2d598ab
commit 8ae0e3dbf8
2 changed files with 1 additions and 1 deletions

View File

@@ -507,7 +507,6 @@ BazaarPluginPrivate::BazaarPluginPrivate()
ActionBuilder createRepository(this, CREATE_REPOSITORY); ActionBuilder createRepository(this, CREATE_REPOSITORY);
createRepository.setText(Tr::tr("Create Repository...")); createRepository.setText(Tr::tr("Create Repository..."));
createRepository.setContext(context);
createRepository.setContainer(bazaarMenuId); createRepository.setContainer(bazaarMenuId);
createRepository.setOnTriggered(this, [this] { this->createRepository(); }); createRepository.setOnTriggered(this, [this] { this->createRepository(); });

View File

@@ -227,6 +227,7 @@ void ActionBuilder::setParameterText(const QString &parameterText,
d->action->setEnablingMode(mode == AlwaysEnabled d->action->setEnablingMode(mode == AlwaysEnabled
? ParameterAction::AlwaysEnabled ? ParameterAction::AlwaysEnabled
: ParameterAction::EnabledWithParameter); : ParameterAction::EnabledWithParameter);
d->action->setText(emptyText);
} }
Command *ActionBuilder::command() const Command *ActionBuilder::command() const