CorePlugin: Pass context object to lambda connections

Remove some unneeded lambda () brackets.

Change-Id: Id664cfc3b46685f63fb205beaf16a7c271ad95d9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2022-12-07 16:25:11 +01:00
parent 94e98281e9
commit 5769fd82d3
23 changed files with 85 additions and 86 deletions

View File

@@ -192,7 +192,7 @@ QList<IWizardFactory*> IWizardFactory::allWizardFactories()
newFactory->m_action = new QAction(newFactory->displayName(), newFactory);
ActionManager::registerAction(newFactory->m_action, actionId(newFactory));
connect(newFactory->m_action, &QAction::triggered, newFactory, [newFactory]() {
connect(newFactory->m_action, &QAction::triggered, newFactory, [newFactory] {
if (!ICore::isNewItemDialogRunning()) {
FilePath path = newFactory->runPath({});
newFactory->runWizard(path, ICore::dialogParent(), Id(), QVariantMap());
@@ -253,15 +253,15 @@ Wizard *IWizardFactory::runWizard(const FilePath &path, QWidget *parent, Id plat
s_currentWizard = wizard;
// Connect while wizard exists:
if (m_action)
connect(m_action, &QAction::triggered, wizard, [wizard]() { ICore::raiseWindow(wizard); });
connect(m_action, &QAction::triggered, wizard, [wizard] { ICore::raiseWindow(wizard); });
connect(s_inspectWizardAction, &QAction::triggered,
wizard, [wizard]() { wizard->showVariables(); });
wizard, [wizard] { wizard->showVariables(); });
connect(wizard, &Utils::Wizard::finished, this, [wizard](int result) {
if (result != QDialog::Accepted)
s_reopenData.clear();
wizard->deleteLater();
});
connect(wizard, &QObject::destroyed, this, []() {
connect(wizard, &QObject::destroyed, this, [] {
s_isWizardRunning = false;
s_currentWizard = nullptr;
s_inspectWizardAction->setEnabled(false);
@@ -405,7 +405,7 @@ void IWizardFactory::initialize()
connect(resetAction, &QAction::triggered, &IWizardFactory::clearWizardFactories);
connect(ICore::instance(), &ICore::newItemDialogStateChanged, resetAction,
[resetAction]() { resetAction->setEnabled(!ICore::isNewItemDialogRunning()); });
[resetAction] { resetAction->setEnabled(!ICore::isNewItemDialogRunning()); });
s_inspectWizardAction = new QAction(tr("Inspect Wizard State"), ActionManager::instance());
ActionManager::registerAction(s_inspectWizardAction, "Wizard.Inspect");