diff --git a/kdevplatform/language/duchain/duchain.cpp b/kdevplatform/language/duchain/duchain.cpp --- a/kdevplatform/language/duchain/duchain.cpp +++ b/kdevplatform/language/duchain/duchain.cpp @@ -275,7 +275,7 @@ private: void run() override { QTimer timer; - connect(&timer, &QTimer::timeout, [this]() { + connect(&timer, &QTimer::timeout, this, [this]() { //Just to make sure the cache is cleared periodically ModificationRevisionSet::clearCache(); diff --git a/kdevplatform/shell/configdialog.cpp b/kdevplatform/shell/configdialog.cpp --- a/kdevplatform/shell/configdialog.cpp +++ b/kdevplatform/shell/configdialog.cpp @@ -54,7 +54,7 @@ connect(button(QDialogButtonBox::Apply), &QPushButton::clicked, onApplyClicked); connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, onApplyClicked); - connect(button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, [this]() { + connect(button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, [this]() { auto page = qobject_cast(currentPage()->widget()); Q_ASSERT(page); page->defaults(); diff --git a/kdevplatform/shell/projectcontroller.cpp b/kdevplatform/shell/projectcontroller.cpp --- a/kdevplatform/shell/projectcontroller.cpp +++ b/kdevplatform/shell/projectcontroller.cpp @@ -164,7 +164,7 @@ emit q->projectConfigurationChanged(proj); }); cfgDlg->setWindowTitle(i18n("Configure Project %1", proj->name())); - QObject::connect(cfgDlg, &KDevelop::ConfigDialog::finished, [proj]() { + QObject::connect(cfgDlg, &KDevelop::ConfigDialog::finished, proj, [proj]() { proj->projectConfiguration()->sync(); }); cfgDlg->show(); diff --git a/plugins/classbrowser/classwidget.cpp b/plugins/classbrowser/classwidget.cpp --- a/plugins/classbrowser/classwidget.cpp +++ b/plugins/classbrowser/classwidget.cpp @@ -66,7 +66,7 @@ // Init filter timer m_filterTimer->setSingleShot(true); - connect(m_filterTimer, &QTimer::timeout, [this]() { + connect(m_filterTimer, &QTimer::timeout, this, [this]() { m_model->updateFilterString(m_filterText); if (m_filterText.isEmpty()) @@ -77,7 +77,7 @@ // Init search box m_searchLine->setClearButtonEnabled( true ); - connect(m_searchLine, &QLineEdit::textChanged, [this](const QString& newFilter) { + connect(m_searchLine, &QLineEdit::textChanged, this, [this](const QString& newFilter) { m_filterText = newFilter; m_filterTimer->start(500); }); diff --git a/plugins/custom-definesandincludes/noprojectincludesanddefines/noprojectincludepathsmanager.cpp b/plugins/custom-definesandincludes/noprojectincludesanddefines/noprojectincludepathsmanager.cpp --- a/plugins/custom-definesandincludes/noprojectincludesanddefines/noprojectincludepathsmanager.cpp +++ b/plugins/custom-definesandincludes/noprojectincludesanddefines/noprojectincludepathsmanager.cpp @@ -147,7 +147,7 @@ cip->setCustomIncludePaths(pathListToStringList(paths)); - QObject::connect(cip, &QDialog::accepted, [this, cip, &path]() { + QObject::connect(cip, &QDialog::accepted, cip, [this, cip, &path]() { if (!writeIncludePaths(cip->storageDirectory(), cip->customIncludePaths())) { qWarning() << i18n("Failed to save custom include paths in directory: %1", cip->storageDirectory()); } diff --git a/plugins/debuggercommon/midebugsession.cpp b/plugins/debuggercommon/midebugsession.cpp --- a/plugins/debuggercommon/midebugsession.cpp +++ b/plugins/debuggercommon/midebugsession.cpp @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -555,16 +554,12 @@ emit debuggerUserCommandOutput(QStringLiteral("(gdb) quit")); // We cannot wait forever, kill gdb after 5 seconds if it's not yet quit - QPointer guarded_this(this); - QTimer::singleShot(5000, [guarded_this](){ - if (guarded_this) { - if (!guarded_this->debuggerStateIsOn(s_programExited) - && guarded_this->debuggerStateIsOn(s_shuttingDown)) { - qCDebug(DEBUGGERCOMMON) << "debugger not shutdown - killing"; - guarded_this->m_debugger->kill(); - guarded_this->setDebuggerState(s_dbgNotStarted | s_appNotStarted); - guarded_this->raiseEvent(debugger_exited); - } + QTimer::singleShot(5000, this, [this]() { + if (!debuggerStateIsOn(s_programExited) && debuggerStateIsOn(s_shuttingDown)) { + qCDebug(DEBUGGERCOMMON) << "debugger not shutdown - killing"; + m_debugger->kill(); + setDebuggerState(s_dbgNotStarted | s_appNotStarted); + raiseEvent(debugger_exited); } });