aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2023-08-01 19:59:54 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2023-08-02 08:55:37 +0000
commitaa016cc5a784098947636b05106ab57ae6e70d38 (patch)
tree4b0a307d47c94375d20e954b9fcdedc21f1c15b2 /src/plugins
parent47fce17aa37f6e0ca003ad07917afbd047179f50 (diff)
Various Plugins: Add context object into connections
Change-Id: I360677bebfef16a3233b3b8177cff6da57ec7c31 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/axivion/axivionplugin.cpp4
-rw-r--r--src/plugins/coreplugin/sessiondialog.cpp2
-rw-r--r--src/plugins/coreplugin/sessionview.cpp4
-rw-r--r--src/plugins/cppcheck/cppcheckplugin.cpp2
-rw-r--r--src/plugins/ctfvisualizer/ctfstatisticsview.cpp2
-rw-r--r--src/plugins/ctfvisualizer/ctfvisualizertool.cpp3
-rw-r--r--src/plugins/fakevim/fakevimplugin.cpp2
-rw-r--r--src/plugins/fossil/fossilclient.cpp12
-rw-r--r--src/plugins/help/helpwidget.cpp7
-rw-r--r--src/plugins/marketplace/qtmarketplacewelcomepage.cpp2
-rw-r--r--src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp6
-rw-r--r--src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp9
-rw-r--r--src/plugins/nim/suggest/nimsuggestcache.cpp2
-rw-r--r--src/plugins/serialterminal/serialcontrol.cpp2
-rw-r--r--src/plugins/serialterminal/serialoutputpane.cpp6
-rw-r--r--src/plugins/welcome/welcomeplugin.cpp4
16 files changed, 35 insertions, 34 deletions
diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp
index 40b2cb6590f..7703fede02c 100644
--- a/src/plugins/axivion/axivionplugin.cpp
+++ b/src/plugins/axivion/axivionplugin.cpp
@@ -205,7 +205,7 @@ void AxivionPluginPrivate::onStartupProjectChanged()
void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName)
{
if (m_runningQuery) { // re-schedule
- QTimer::singleShot(3000, [this, projectName]{ fetchProjectInfo(projectName); });
+ QTimer::singleShot(3000, this, [this, projectName] { fetchProjectInfo(projectName); });
return;
}
clearAllMarks();
@@ -228,7 +228,7 @@ void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName)
void AxivionPluginPrivate::fetchRuleInfo(const QString &id)
{
if (m_runningQuery) {
- QTimer::singleShot(3000, [this, id]{ fetchRuleInfo(id); });
+ QTimer::singleShot(3000, this, [this, id] { fetchRuleInfo(id); });
return;
}
diff --git a/src/plugins/coreplugin/sessiondialog.cpp b/src/plugins/coreplugin/sessiondialog.cpp
index f0789cf45ba..5ab1343a963 100644
--- a/src/plugins/coreplugin/sessiondialog.cpp
+++ b/src/plugins/coreplugin/sessiondialog.cpp
@@ -93,7 +93,7 @@ SessionNameInputDialog::SessionNameInputDialog(QWidget *parent)
}.attachTo(this);
// clang-format on
- connect(m_newSessionLineEdit, &QLineEdit::textChanged, [this](const QString &text) {
+ connect(m_newSessionLineEdit, &QLineEdit::textChanged, this, [this](const QString &text) {
m_okButton->setEnabled(!text.isEmpty());
m_switchToButton->setEnabled(!text.isEmpty());
});
diff --git a/src/plugins/coreplugin/sessionview.cpp b/src/plugins/coreplugin/sessionview.cpp
index c3d7ed25b30..4b03c929900 100644
--- a/src/plugins/coreplugin/sessionview.cpp
+++ b/src/plugins/coreplugin/sessionview.cpp
@@ -54,10 +54,10 @@ SessionView::SessionView(QWidget *parent)
selectionModel()->select(firstRow, QItemSelectionModel::QItemSelectionModel::
SelectCurrent);
- connect(this, &Utils::TreeView::activated, [this](const QModelIndex &index){
+ connect(this, &Utils::TreeView::activated, this, [this](const QModelIndex &index){
emit sessionActivated(m_sessionModel.sessionAt(index.row()));
});
- connect(selectionModel(), &QItemSelectionModel::selectionChanged, [this] {
+ connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, [this] {
emit sessionsSelected(selectedSessions());
});
diff --git a/src/plugins/cppcheck/cppcheckplugin.cpp b/src/plugins/cppcheck/cppcheckplugin.cpp
index 261eb50b0a5..8f80707a240 100644
--- a/src/plugins/cppcheck/cppcheckplugin.cpp
+++ b/src/plugins/cppcheck/cppcheckplugin.cpp
@@ -55,7 +55,7 @@ public:
CppcheckPluginPrivate::CppcheckPluginPrivate()
{
tool.updateOptions();
- connect(&settings(), &AspectContainer::changed, [this] {
+ connect(&settings(), &AspectContainer::changed, this, [this] {
tool.updateOptions();
trigger.recheck();
});
diff --git a/src/plugins/ctfvisualizer/ctfstatisticsview.cpp b/src/plugins/ctfvisualizer/ctfstatisticsview.cpp
index 3ca6a4738dd..3e8ff8a40b8 100644
--- a/src/plugins/ctfvisualizer/ctfstatisticsview.cpp
+++ b/src/plugins/ctfvisualizer/ctfstatisticsview.cpp
@@ -31,7 +31,7 @@ CtfStatisticsView::CtfStatisticsView(CtfStatisticsModel *model, QWidget *parent)
setUniformRowHeights(true);
setSortingEnabled(true);
- connect(selectionModel(), &QItemSelectionModel::currentChanged,
+ connect(selectionModel(), &QItemSelectionModel::currentChanged, this,
[this] (const QModelIndex &current, const QModelIndex &previous)
{
Q_UNUSED(previous);
diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp
index 05cf55d729f..c5ca64eeb31 100644
--- a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp
+++ b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp
@@ -97,8 +97,7 @@ void CtfVisualizerTool::createViews()
m_statisticsView = new CtfStatisticsView(m_statisticsModel.get());
m_statisticsView->setWindowTitle(Tr::tr("Statistics"));
- connect(m_statisticsView, &CtfStatisticsView::eventTypeSelected, [this] (QString title)
- {
+ connect(m_statisticsView, &CtfStatisticsView::eventTypeSelected, this, [this](QString title) {
int typeId = m_traceManager->getSelectionId(title.toStdString());
m_traceView->selectByTypeId(typeId);
});
diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp
index afebf316c9c..dffae9b45cd 100644
--- a/src/plugins/fakevim/fakevimplugin.cpp
+++ b/src/plugins/fakevim/fakevimplugin.cpp
@@ -502,7 +502,7 @@ FakeVimExCommandsMappings::FakeVimExCommandsMappings()
auto infoLabel = new InfoLabel(Tr::tr("Invalid regular expression."), InfoLabel::Error);
infoLabel->setVisible(false);
- connect(m_commandEdit, &FancyLineEdit::validChanged, [infoLabel](bool valid){
+ connect(m_commandEdit, &FancyLineEdit::validChanged, this, [infoLabel](bool valid){
infoLabel->setVisible(!valid);
});
commandBoxLayout->addWidget(infoLabel);
diff --git a/src/plugins/fossil/fossilclient.cpp b/src/plugins/fossil/fossilclient.cpp
index db23a6fcac9..7f4ebd206c5 100644
--- a/src/plugins/fossil/fossilclient.cpp
+++ b/src/plugins/fossil/fossilclient.cpp
@@ -915,8 +915,10 @@ void FossilClient::log(const FilePath &workingDir, const QStringList &files,
if (VcsBaseEditorConfig *editorConfig = createLogEditor(fossilEditor)) {
editorConfig->setBaseArguments(extraOptions);
// editor has been just created, createVcsEditor() didn't set a configuration widget yet
- connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested,
- [=]() { this->log(workingDir, files, editorConfig->arguments(), enableAnnotationContextMenu, addAuthOptions); } );
+ connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested, this, [=] {
+ log(workingDir, files, editorConfig->arguments(), enableAnnotationContextMenu,
+ addAuthOptions);
+ });
fossilEditor->setEditorConfig(editorConfig);
}
}
@@ -968,8 +970,10 @@ void FossilClient::logCurrentFile(const FilePath &workingDir, const QStringList
if (VcsBaseEditorConfig *editorConfig = createLogCurrentFileEditor(fossilEditor)) {
editorConfig->setBaseArguments(extraOptions);
// editor has been just created, createVcsEditor() didn't set a configuration widget yet
- connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested,
- [=]() { this->logCurrentFile(workingDir, files, editorConfig->arguments(), enableAnnotationContextMenu, addAuthOptions); } );
+ connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested, this, [=] {
+ logCurrentFile(workingDir, files, editorConfig->arguments(),
+ enableAnnotationContextMenu, addAuthOptions);
+ });
fossilEditor->setEditorConfig(editorConfig);
}
}
diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp
index 67b42232c90..a2d9eca985a 100644
--- a/src/plugins/help/helpwidget.cpp
+++ b/src/plugins/help/helpwidget.cpp
@@ -323,14 +323,11 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
helpTargetButton->setProperty(Utils::StyleHelper::C_NO_ARROW, true);
helpTargetButton->setPopupMode(QToolButton::DelayedPopup);
helpTargetButton->setMenu(createHelpTargetMenu(helpTargetButton));
- connect(LocalHelpManager::instance(),
- &LocalHelpManager::contextHelpOptionChanged,
+ connect(LocalHelpManager::instance(), &LocalHelpManager::contextHelpOptionChanged, this,
[this, helpTargetAction] {
helpTargetAction->setChecked(isTargetOfContextHelp(m_style));
});
- connect(helpTargetAction,
- &QAction::triggered,
- this,
+ connect(helpTargetAction, &QAction::triggered, this,
[this, helpTargetAction, helpTargetButton](bool checked) {
if (checked) {
LocalHelpManager::setContextHelpOption(optionForStyle(m_style));
diff --git a/src/plugins/marketplace/qtmarketplacewelcomepage.cpp b/src/plugins/marketplace/qtmarketplacewelcomepage.cpp
index 44272858c5e..b894454b18d 100644
--- a/src/plugins/marketplace/qtmarketplacewelcomepage.cpp
+++ b/src/plugins/marketplace/qtmarketplacewelcomepage.cpp
@@ -74,7 +74,7 @@ public:
connect(m_sectionedProducts, &SectionedProducts::toggleProgressIndicator,
progressIndicator, &Utils::ProgressIndicator::setVisible);
- connect(m_sectionedProducts, &SectionedProducts::errorOccurred,
+ connect(m_sectionedProducts, &SectionedProducts::errorOccurred, this,
[this, progressIndicator, searchBox](int, const QString &message) {
progressIndicator->hide();
progressIndicator->deleteLater();
diff --git a/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp b/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp
index 9702fb77bfb..897fcd0aa14 100644
--- a/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp
+++ b/src/plugins/mcusupport/dialogs/mcukitcreationdialog.cpp
@@ -89,9 +89,9 @@ McuKitCreationDialog::McuKitCreationDialog(const MessagesList &messages,
if (qtMCUPackage->isValidStatus())
m_qtMCUsPathLabel->setText(
Tr::tr("Qt for MCUs path %1").arg(qtMCUPackage->path().toUserOutput()));
- connect(m_nextButton, &QPushButton::clicked, [=] { updateMessage(1); });
- connect(m_previousButton, &QPushButton::clicked, [=] { updateMessage(-1); });
- connect(fixButton, &QPushButton::clicked, [=] {
+ connect(m_nextButton, &QPushButton::clicked, this, [this] { updateMessage(1); });
+ connect(m_previousButton, &QPushButton::clicked, this, [this] { updateMessage(-1); });
+ connect(fixButton, &QPushButton::clicked, this, [this, settingsHandler] {
// Open the MCU Options widget on the current platform
settingsHandler->setInitialPlatformName(m_messages[m_currentIndex].platform);
Core::ICore::showOptionsDialog(Constants::SETTINGS_ID);
diff --git a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp
index a8722fc24fc..579efa7035f 100644
--- a/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp
+++ b/src/plugins/mesonprojectmanager/mesonbuildconfiguration.cpp
@@ -221,7 +221,8 @@ public:
m_showProgressTimer.setSingleShot(true);
m_showProgressTimer.setInterval(50); // don't show progress for < 50ms tasks
- connect(&m_showProgressTimer, &QTimer::timeout, [this]() { m_progressIndicator.show(); });
+ connect(&m_showProgressTimer, &QTimer::timeout,
+ this, [this] { m_progressIndicator.show(); });
connect(&m_optionsModel, &BuidOptionsModel::configurationChanged, this, [configureButton] {
configureButton->setEnabled(true);
});
@@ -274,13 +275,15 @@ public:
optionsTreeView,
[tree = optionsTreeView](const QModelIndex &idx) { tree->edit(idx); });
- connect(configureButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] {
+ connect(configureButton, &QPushButton::clicked,
+ this, [this, bs, configureButton, optionsTreeView] {
optionsTreeView->setEnabled(false);
configureButton->setEnabled(false);
m_showProgressTimer.start();
bs->configure();
});
- connect(wipeButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] {
+ connect(wipeButton, &QPushButton::clicked,
+ this, [this, bs, configureButton, optionsTreeView] {
optionsTreeView->setEnabled(false);
configureButton->setEnabled(false);
m_showProgressTimer.start();
diff --git a/src/plugins/nim/suggest/nimsuggestcache.cpp b/src/plugins/nim/suggest/nimsuggestcache.cpp
index 92bca20d5e9..fa4751cb5c1 100644
--- a/src/plugins/nim/suggest/nimsuggestcache.cpp
+++ b/src/plugins/nim/suggest/nimsuggestcache.cpp
@@ -22,7 +22,7 @@ public:
NimSuggestCache()
{
setExecutablePath(settings().nimSuggestPath());
- QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, [this] {
+ QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, this, [this] {
setExecutablePath(settings().nimSuggestPath());
});
diff --git a/src/plugins/serialterminal/serialcontrol.cpp b/src/plugins/serialterminal/serialcontrol.cpp
index 0c034f1cb18..2ec8fe3523f 100644
--- a/src/plugins/serialterminal/serialcontrol.cpp
+++ b/src/plugins/serialterminal/serialcontrol.cpp
@@ -151,7 +151,7 @@ QString SerialControl::baudRateText() const
void SerialControl::pulseDataTerminalReady()
{
m_serialPort.setDataTerminalReady(!m_initialDtrState);
- QTimer::singleShot(Constants::RESET_DELAY, [&]() {
+ QTimer::singleShot(Constants::RESET_DELAY, this, [this] {
m_serialPort.setDataTerminalReady(m_initialDtrState);
});
}
diff --git a/src/plugins/serialterminal/serialoutputpane.cpp b/src/plugins/serialterminal/serialoutputpane.cpp
index 7a92424d7b8..b343ea478ee 100644
--- a/src/plugins/serialterminal/serialoutputpane.cpp
+++ b/src/plugins/serialterminal/serialoutputpane.cpp
@@ -257,14 +257,12 @@ void SerialOutputPane::createNewOutputWindow(SerialControl *rc)
return;
// Signals to update buttons
- connect(rc, &SerialControl::started,
- [this, rc]() {
+ connect(rc, &SerialControl::started, this, [this, rc] {
if (isCurrent(rc))
enableButtons(rc, true);
});
- connect(rc, &SerialControl::finished,
- [this, rc]() {
+ connect(rc, &SerialControl::finished, this, [this, rc] {
const int tabIndex = indexOf(rc);
if (tabIndex != -1)
m_serialControlTabs[tabIndex].window->flush();
diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp
index d4089de465a..8cc8165aa29 100644
--- a/src/plugins/welcome/welcomeplugin.cpp
+++ b/src/plugins/welcome/welcomeplugin.cpp
@@ -351,12 +351,12 @@ WelcomeMode::WelcomeMode()
m_modeWidget = new ResizeSignallingWidget;
m_modeWidget->setPalette(palette);
- connect(m_modeWidget, &ResizeSignallingWidget::resized,
+ connect(m_modeWidget, &ResizeSignallingWidget::resized, this,
[this](const QSize &size, const QSize &) {
const bool hideSideArea = size.width() <= 750;
const bool hideBottomArea = size.width() <= 850;
const bool compactVertically = size.height() <= 530;
- QTimer::singleShot(0, [this, hideSideArea, hideBottomArea, compactVertically]() {
+ QTimer::singleShot(0, this, [this, hideSideArea, hideBottomArea, compactVertically] {
m_sideArea->setVisible(!hideSideArea);
m_bottomArea->setVisible(!(hideBottomArea || compactVertically));
m_topArea->setCompact(compactVertically);