diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-09-07 17:05:47 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-09-08 09:06:53 +0000 |
commit | 47886969cc340745a517d76c81b69fd7954fa173 (patch) | |
tree | 91875446d6f865510e071ede477b81e5c8aea5ad | |
parent | e3ae628584f2434b6cc9210726deafd55769c260 (diff) |
Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".
Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
55 files changed, 216 insertions, 218 deletions
diff --git a/src/libs/qmldebug/qmldebugclient.cpp b/src/libs/qmldebug/qmldebugclient.cpp index 1b27ee2a12..ffa21a458c 100644 --- a/src/libs/qmldebug/qmldebugclient.cpp +++ b/src/libs/qmldebug/qmldebugclient.cpp @@ -397,7 +397,7 @@ void QmlDebugConnection::newConnection() connect(socket, &QLocalSocket::disconnected, this, &QmlDebugConnection::socketDisconnected); connect(socket, static_cast<void (QLocalSocket::*)(QLocalSocket::LocalSocketError)> - (&QLocalSocket::error), this, [this, d](QLocalSocket::LocalSocketError error) { + (&QLocalSocket::error), this, [this](QLocalSocket::LocalSocketError error) { emit logError(socketErrorToString(static_cast<QAbstractSocket::SocketError>(error))); socketDisconnected(); }); diff --git a/src/libs/ssh/sshagent.cpp b/src/libs/ssh/sshagent.cpp index 1ada40fcd1..4e581fac0a 100644 --- a/src/libs/ssh/sshagent.cpp +++ b/src/libs/ssh/sshagent.cpp @@ -57,7 +57,7 @@ void SshAgent::refreshKeysImpl() if (state() != Connected) return; const auto keysRequestIt = std::find_if(m_pendingRequests.constBegin(), - m_pendingRequests.constEnd(), [this](const Request &r) { return r.isKeysRequest(); }); + m_pendingRequests.constEnd(), [](const Request &r) { return r.isKeysRequest(); }); if (keysRequestIt != m_pendingRequests.constEnd()) { qCDebug(sshLog) << "keys request already pending, not adding another one"; return; diff --git a/src/plugins/android/androidanalyzesupport.cpp b/src/plugins/android/androidanalyzesupport.cpp index 59ccb047ca..391be4b500 100644 --- a/src/plugins/android/androidanalyzesupport.cpp +++ b/src/plugins/android/androidanalyzesupport.cpp @@ -42,7 +42,7 @@ AndroidQmlProfilerSupport::AndroidQmlProfilerSupport(RunControl *runControl) auto profiler = runControl->createWorker(runControl->runMode()); profiler->addStartDependency(this); - connect(runner, &AndroidRunner::qmlServerReady, [this, runner, profiler](const QUrl &server) { + connect(runner, &AndroidRunner::qmlServerReady, this, [this, profiler](const QUrl &server) { profiler->recordData("QmlServerUrl", server); reportStarted(); }); diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 3d00400ccd..461d204b8c 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -116,7 +116,7 @@ void AutotestPlugin::initializeMenuEntries() action = new QAction(tr("Re&scan Tests"), this); command = ActionManager::registerAction(action, Constants::ACTION_SCAN_ID); command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+T,Alt+S"))); - connect(action, &QAction::triggered, [this] () { + connect(action, &QAction::triggered, this, [] () { TestTreeModel::instance()->parser()->updateTestTree(); }); menu->addAction(command); diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index ce0a655c2c..feb32c58db 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -402,7 +402,7 @@ void TestCodeParser::scanForTests(const QStringList &fileList, ITestParser *pars parser->init(list); QFuture<TestParseResultPtr> future = Utils::map(list, - [this, codeParsers](QFutureInterface<TestParseResultPtr> &fi, const QString &file) { + [codeParsers](QFutureInterface<TestParseResultPtr> &fi, const QString &file) { parseFileForTests(codeParsers, fi, file); }, Utils::MapReduceOption::Unordered, diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index 6db3bb3489..a879d35c54 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -370,7 +370,7 @@ void TestRunner::debugTests() connect(outputreader, &TestOutputReader::newOutputAvailable, TestResultsPane::instance(), &TestResultsPane::addOutput); connect(runControl, &ProjectExplorer::RunControl::appendMessageRequested, - this, [this, outputreader] + this, [outputreader] (ProjectExplorer::RunControl *, const QString &msg, Utils::OutputFormat format) { processOutput(outputreader, msg, format); }); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 84e3b147a4..59bdaf1168 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -277,7 +277,7 @@ QList<ConfigModel::DataItem> CMakeBuildConfiguration::completeCMakeConfiguration return QList<ConfigModel::DataItem>(); return Utils::transform(m_buildDirManager->parsedConfiguration(), - [this](const CMakeConfigItem &i) { + [](const CMakeConfigItem &i) { ConfigModel::DataItem j; j.key = QString::fromUtf8(i.key); j.value = QString::fromUtf8(i.value); diff --git a/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp b/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp index f0be80b42e..47eeef30a8 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp @@ -334,7 +334,7 @@ void CMakeGeneratorKitConfigWidget::changeGenerator() for (auto it = generatorList.constBegin(); it != generatorList.constEnd(); ++it) generatorCombo->addItem(it->name); - auto updateDialog = [this, &generatorList, generatorCombo, extraGeneratorCombo, + auto updateDialog = [&generatorList, generatorCombo, extraGeneratorCombo, platformEdit, toolsetEdit](const QString &name) { auto it = std::find_if(generatorList.constBegin(), generatorList.constEnd(), [name](const CMakeTool::Generator &g) { return g.name == name; }); diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 4509afe584..3a52d6911c 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -148,7 +148,7 @@ KitConfigWidget *CMakeKitInformation::createConfigWidget(Kit *k) const void CMakeKitInformation::addToMacroExpander(Kit *k, Utils::MacroExpander *expander) const { expander->registerFileVariables("CMake:Executable", tr("Path to the cmake executable"), - [this, k]() -> QString { + [k]() -> QString { CMakeTool *tool = CMakeKitInformation::cmakeTool(k); return tool ? tool->cmakeExecutable().toString() : QString(); }); diff --git a/src/plugins/cmakeprojectmanager/tealeafreader.cpp b/src/plugins/cmakeprojectmanager/tealeafreader.cpp index eed99dad19..ca3794c89d 100644 --- a/src/plugins/cmakeprojectmanager/tealeafreader.cpp +++ b/src/plugins/cmakeprojectmanager/tealeafreader.cpp @@ -554,7 +554,7 @@ void TeaLeafReader::processCMakeOutput() { static QString rest; rest = lineSplit(rest, m_cmakeProcess->readAllStandardOutput(), - [this](const QString &s) { MessageManager::write(s); }); + [](const QString &s) { MessageManager::write(s); }); } void TeaLeafReader::processCMakeError() diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 8f661064ea..1b62ad7543 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -382,7 +382,7 @@ void EditorManagerPrivate::init() cmd = ActionManager::registerAction(m_splitAction, Constants::SPLIT, editManagerContext); cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+E,2") : tr("Ctrl+E,2"))); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); - connect(m_splitAction, &QAction::triggered, this, [this]() { split(Qt::Vertical); }); + connect(m_splitAction, &QAction::triggered, this, []() { split(Qt::Vertical); }); m_splitSideBySideAction = new QAction(Utils::Icons::SPLIT_VERTICAL.icon(), tr("Split Side by Side"), this); @@ -396,7 +396,7 @@ void EditorManagerPrivate::init() cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+E,4") : tr("Ctrl+E,4"))); mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); connect(m_splitNewWindowAction, &QAction::triggered, - this, [this]() { splitNewWindow(currentEditorView()); }); + this, []() { splitNewWindow(currentEditorView()); }); m_removeCurrentSplitAction = new QAction(tr("Remove Current Split"), this); cmd = ActionManager::registerAction(m_removeCurrentSplitAction, Constants::REMOVE_CURRENT_SPLIT, editManagerContext); diff --git a/src/plugins/coreplugin/externaltoolmanager.cpp b/src/plugins/coreplugin/externaltoolmanager.cpp index c6ec74f28b..80d98243b6 100644 --- a/src/plugins/coreplugin/externaltoolmanager.cpp +++ b/src/plugins/coreplugin/externaltoolmanager.cpp @@ -77,7 +77,7 @@ ExternalToolManager::ExternalToolManager() d->m_configureSeparator = new QAction(this); d->m_configureSeparator->setSeparator(true); d->m_configureAction = new QAction(ICore::msgShowOptionsDialog(), this); - connect(d->m_configureAction, &QAction::triggered, [this] { + connect(d->m_configureAction, &QAction::triggered, this, [] { ICore::showOptionsDialog(Constants::SETTINGS_ID_TOOLS); }); diff --git a/src/plugins/coreplugin/find/findplugin.cpp b/src/plugins/coreplugin/find/findplugin.cpp index 9e8d3207be..7509d5c0df 100644 --- a/src/plugins/coreplugin/find/findplugin.cpp +++ b/src/plugins/coreplugin/find/findplugin.cpp @@ -192,7 +192,7 @@ void FindPrivate::setupMenu() cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F"))); mfindadvanced->addAction(cmd); connect(m_openFindDialog, &QAction::triggered, - this, [this] { Find::openFindDialog(nullptr); }); + this, [] { Find::openFindDialog(nullptr); }); } static QString filterActionName(const IFindFilter *filter) @@ -220,8 +220,7 @@ void FindPrivate::setupFilterMenuItems() cmd->setDefaultKeySequence(filter->defaultShortcut()); cmd->setAttribute(Command::CA_UpdateText); mfindadvanced->addAction(cmd); - connect(action, &QAction::triggered, - this, [filter, action] { Find::openFindDialog(filter); }); + connect(action, &QAction::triggered, this, [filter] { Find::openFindDialog(filter); }); connect(filter, &IFindFilter::enabledChanged, this, [filter, action] { action->setEnabled(filter->isEnabled()); d->m_openFindDialog->setEnabled(d->isAnyFilterEnabled()); diff --git a/src/plugins/coreplugin/iwizardfactory.cpp b/src/plugins/coreplugin/iwizardfactory.cpp index 238f992a32..bce8c7cd3f 100644 --- a/src/plugins/coreplugin/iwizardfactory.cpp +++ b/src/plugins/coreplugin/iwizardfactory.cpp @@ -287,7 +287,7 @@ Utils::Wizard *IWizardFactory::runWizard(const QString &path, QWidget *parent, I s_reopenData.clear(); wizard->deleteLater(); }); - connect(wizard, &QObject::destroyed, this, [wizard]() { + connect(wizard, &QObject::destroyed, this, []() { s_isWizardRunning = false; s_currentWizard = nullptr; s_inspectWizardAction->setEnabled(false); diff --git a/src/plugins/coreplugin/jsexpander.cpp b/src/plugins/coreplugin/jsexpander.cpp index 8eee995094..0c44512497 100644 --- a/src/plugins/coreplugin/jsexpander.cpp +++ b/src/plugins/coreplugin/jsexpander.cpp @@ -84,7 +84,7 @@ JsExpander::JsExpander() QCoreApplication::translate("Core::JsExpander", "Evaluate simple JavaScript statements.<br>" "The statements may not contain '{' nor '}' characters."), - [this](QString in) -> QString { + [](QString in) -> QString { QString errorMessage; QString result = JsExpander::evaluate(in, &errorMessage); if (!errorMessage.isEmpty()) { diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 5b65b2b97d..13d7036d8f 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -505,7 +505,7 @@ void MainWindow::registerDefaultActions() cmd = ActionManager::registerAction(m_newAction, Constants::NEW); cmd->setDefaultKeySequence(QKeySequence::New); mfile->addAction(cmd, Constants::G_FILE_NEW); - connect(m_newAction, &QAction::triggered, this, [this]() { + connect(m_newAction, &QAction::triggered, this, []() { if (!ICore::isNewItemDialogRunning()) { ICore::showNewItemDialog(tr("New File or Project", "Title of dialog"), IWizardFactory::allWizardFactories(), QString()); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 1b8a49356e..cc74b81105 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -3390,7 +3390,7 @@ public: auto layout = new QFormLayout(&dlg); auto funcNameEdit = new Utils::FancyLineEdit; - funcNameEdit->setValidationFunction([this](Utils::FancyLineEdit *edit, QString *) { + funcNameEdit->setValidationFunction([](Utils::FancyLineEdit *edit, QString *) { return ExtractFunctionOptions::isValidFunctionName(edit->text()); }); layout->addRow(QCoreApplication::translate("QuickFix::ExtractFunction", diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index e8fe2145f2..d0dfec3a56 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -205,10 +205,10 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error) Utils::MacroExpander *expander = Utils::globalMacroExpander(); expander->registerVariable("Cpp:LicenseTemplate", tr("The license template."), - [this]() { return CppToolsPlugin::licenseTemplate(); }); + []() { return CppToolsPlugin::licenseTemplate(); }); expander->registerFileVariables("Cpp:LicenseTemplatePath", tr("The configured path to the license template"), - [this]() { return CppToolsPlugin::licenseTemplatePath().toString(); }); + []() { return CppToolsPlugin::licenseTemplatePath().toString(); }); return true; } diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index ab80f73c16..df579b8a60 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -2012,7 +2012,7 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev) addAction(menu, tr("Synchronize Breakpoints"), Internal::hasSnapshots(), - [this] { Internal::synchronizeBreakpoints(); }); + [] { Internal::synchronizeBreakpoints(); }); menu->addSeparator(); menu->addAction(action(UseToolTipsInBreakpointsView)); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index fc6ae9ac37..14c9938114 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -445,7 +445,7 @@ void CdbEngine::consoleStubExited() void CdbEngine::createFullBacktrace() { - runCommand({"~*kp", BuiltinCommand, [this](const DebuggerResponse &response) { + runCommand({"~*kp", BuiltinCommand, [](const DebuggerResponse &response) { Internal::openTextEditor("Backtrace $", response.data.data()); }}); } @@ -1423,7 +1423,7 @@ void CdbEngine::postDisassemblerCommand(quint64 address, quint64 endAddress, str << "u " << hex <<hexPrefixOn << address << ' ' << endAddress; DebuggerCommand cmd; cmd.function = ba; - cmd.callback = [this, agent](const DebuggerResponse &response) { + cmd.callback = [agent](const DebuggerResponse &response) { // Parse: "00000000`77606060 cc int 3" agent->setContents(parseCdbDisassembler(response.data.data())); }; diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index 311b1fcf5a..949fcfd47f 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -228,7 +228,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent) setWindowTitle(tr("Start Debugger")); d->kitChooser = new KitChooser(this); - d->kitChooser->setKitPredicate([this](const Kit *k) { + d->kitChooser->setKitPredicate([](const Kit *k) { return !DebuggerKitInformation::configurationErrors(k); }); d->kitChooser->populate(); diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 5bc634fed8..d5ab9d0aae 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -300,26 +300,26 @@ KitConfigWidget *DebuggerKitInformation::createConfigWidget(Kit *k) const void DebuggerKitInformation::addToMacroExpander(Kit *kit, MacroExpander *expander) const { expander->registerVariable("Debugger:Name", tr("Name of Debugger"), - [this, kit]() -> QString { + [kit]() -> QString { const DebuggerItem *item = debugger(kit); return item ? item->displayName() : tr("Unknown debugger"); }); expander->registerVariable("Debugger:Type", tr("Type of Debugger Backend"), - [this, kit]() -> QString { + [kit]() -> QString { const DebuggerItem *item = debugger(kit); return item ? item->engineTypeName() : tr("Unknown debugger type"); }); expander->registerVariable("Debugger:Version", tr("Debugger"), - [this, kit]() -> QString { + [kit]() -> QString { const DebuggerItem *item = debugger(kit); return item && !item->version().isEmpty() ? item->version() : tr("Unknown debugger version"); }); expander->registerVariable("Debugger:Abi", tr("Debugger"), - [this, kit]() -> QString { + [kit]() -> QString { const DebuggerItem *item = debugger(kit); return item && !item->abis().isEmpty() ? item->abiNames().join(QLatin1Char(' ')) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index b76a2734ba..aed8ab1b89 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2347,7 +2347,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget, auto act = menu->addAction(args.address ? DebuggerEngine::tr("Run to Address 0x%1").arg(args.address, 0, 16) : DebuggerEngine::tr("Run to Line %1").arg(args.lineNumber)); - connect(act, &QAction::triggered, [this, args] { + connect(act, &QAction::triggered, this, [args] { DebuggerEngine *engine = currentEngine(); QTC_ASSERT(engine, return); engine->executeRunToLine(args); @@ -2357,7 +2357,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget, auto act = menu->addAction(args.address ? DebuggerEngine::tr("Jump to Address 0x%1").arg(args.address, 0, 16) : DebuggerEngine::tr("Jump to Line %1").arg(args.lineNumber)); - connect(act, &QAction::triggered, [this, args] { + connect(act, &QAction::triggered, this, [args] { DebuggerEngine *engine = currentEngine(); QTC_ASSERT(engine, return); engine->executeJumpToLine(args); @@ -2372,7 +2372,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget, const QString text = tr("Disassemble Function \"%1\"") .arg(frame.function); auto act = new QAction(text, menu); - connect(act, &QAction::triggered, [this, frame] { + connect(act, &QAction::triggered, this, [frame] { DebuggerEngine *engine = currentEngine(); QTC_ASSERT(engine, return); engine->openDisassemblerView(Location(frame)); @@ -3714,7 +3714,7 @@ void DebuggerUnitTests::testStateMachine() auto runControl = new RunControl(rc, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto runTool = new DebuggerRunTool(runControl, rp); - connect(runTool, &DebuggerRunTool::stopped, this, [this] { + connect(runTool, &DebuggerRunTool::stopped, this, [] { QTestEventLoop::instance().exitLoop(); }); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 91a5fea8c5..2d240a793a 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4232,7 +4232,7 @@ void GdbEngine::handleAdapterCrashed(const QString &msg) void GdbEngine::createFullBacktrace() { DebuggerCommand cmd("thread apply all bt full", NeedsTemporaryStop | ConsoleCommand); - cmd.callback = [this](const DebuggerResponse &response) { + cmd.callback = [](const DebuggerResponse &response) { if (response.resultClass == ResultDone) { Internal::openTextEditor("Backtrace $", response.consoleStreamOutput + response.logStreamOutput); diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 9aedd4c3a1..404ce3e2fa 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -574,7 +574,7 @@ void LldbEngine::removeBreakpoint(Breakpoint bp) if (response.id.isValid()) { DebuggerCommand cmd("removeBreakpoint"); cmd.arg("lldbid", response.id.toString()); - cmd.callback = [this, bp](const DebuggerResponse &) { + cmd.callback = [bp](const DebuggerResponse &) { QTC_CHECK(bp.state() == BreakpointRemoveProceeding); Breakpoint bp0 = bp; bp0.notifyBreakpointRemoveOk(); @@ -679,7 +679,7 @@ void LldbEngine::requestModuleSymbols(const QString &moduleName) { DebuggerCommand cmd("fetchSymbols"); cmd.arg("module", moduleName); - cmd.callback = [this, moduleName](const DebuggerResponse &response) { + cmd.callback = [moduleName](const DebuggerResponse &response) { const GdbMi &symbols = response.data["symbols"]; QString moduleName = response.data["module"].data(); Symbols syms; @@ -1041,7 +1041,7 @@ void LldbEngine::fetchMemory(MemoryAgent *agent, quint64 addr, quint64 length) DebuggerCommand cmd("fetchMemory"); cmd.arg("address", addr); cmd.arg("length", length); - cmd.callback = [this, agent](const DebuggerResponse &response) { + cmd.callback = [agent](const DebuggerResponse &response) { qulonglong addr = response.data["address"].toAddress(); QByteArray ba = QByteArray::fromHex(response.data["contents"].data().toUtf8()); agent->addData(addr, ba); @@ -1055,7 +1055,7 @@ void LldbEngine::changeMemory(MemoryAgent *agent, quint64 addr, const QByteArray DebuggerCommand cmd("writeMemory"); cmd.arg("address", addr); cmd.arg("data", QString::fromUtf8(data.toHex())); - cmd.callback = [this](const DebuggerResponse &response) { Q_UNUSED(response); }; + cmd.callback = [](const DebuggerResponse &response) { Q_UNUSED(response); }; runCommand(cmd); } diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index e37c44ccbb..5139989b0e 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -196,7 +196,7 @@ bool ModulesModel::contextMenuEvent(const ItemViewEvent &ev) addAction(menu, tr("Show Dependencies of \"%1\"").arg(moduleName), tr("Show Dependencies"), moduleNameValid && !moduleName.isEmpty() && HostOsInfo::isWindowsHost(), - [this, modulePath] { QProcess::startDetached("depends", {modulePath}); }); + [modulePath] { QProcess::startDetached("depends", {modulePath}); }); addAction(menu, tr("Load Symbols for All Modules"), enabled && canLoadSymbols, diff --git a/src/plugins/debugger/registerhandler.cpp b/src/plugins/debugger/registerhandler.cpp index 0cf5de70c7..5ae39c1af5 100644 --- a/src/plugins/debugger/registerhandler.cpp +++ b/src/plugins/debugger/registerhandler.cpp @@ -742,8 +742,10 @@ bool RegisterHandler::contextMenuEvent(const ItemViewEvent &ev) ? registerSubItem->parent()->m_format : HexadecimalFormat; - auto addFormatAction = [this, menu, currentFormat, registerItem](const QString &display, RegisterFormat format) { - addCheckableAction(menu, display, registerItem, currentFormat == format, [this, registerItem, format] { + auto addFormatAction = + [menu, currentFormat, registerItem](const QString &display, RegisterFormat format) { + addCheckableAction(menu, display, registerItem, currentFormat == format, + [registerItem, format] { registerItem->m_format = format; registerItem->update(); }); diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 0afb0ba9bc..a4f6c650e2 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -418,7 +418,7 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev) }); addAction(menu, tr("Disassemble Function..."), true, - [this, address] { + [this] { const StackFrame frame = inputFunctionForDisassembly(); if (!frame.function.isEmpty()) m_engine->openDisassemblerView(Location(frame)); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 84d66f2a89..96194f869a 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1679,7 +1679,7 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev) addAction(menu, tr("Close Editor Tooltips"), DebuggerToolTipManager::hasToolTips(), - [this] { DebuggerToolTipManager::closeAllToolTips(); }); + [] { DebuggerToolTipManager::closeAllToolTips(); }); addAction(menu, tr("Copy View Contents to Clipboard"), true, @@ -1687,7 +1687,7 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev) addAction(menu, tr("Copy Current Value to Clipboard"), item, - [this, item] { copyToClipboard(item->value); }); + [item] { copyToClipboard(item->value); }); // addAction(menu, tr("Copy Selected Rows to Clipboard"), // selectionModel()->hasSelection(), @@ -1791,7 +1791,7 @@ QMenu *WatchModel::createMemoryMenu(WatchItem *item) addAction(menu, tr("Open Memory Editor Showing Stack Layout"), item && item->isLocal(), - [this, item, pos] { addStackLayoutMemoryView(false, pos); }); + [this, pos] { addStackLayoutMemoryView(false, pos); }); addAction(menu, tr("Open Memory Editor..."), true, @@ -1835,8 +1835,6 @@ QMenu *WatchModel::createFormatMenu(WatchItem *item) addBaseChangeAction(tr("Show Unprintable Characters as Octal"), 8); addBaseChangeAction(tr("Show Unprintable Characters as Hexadecimal"), 16); - QAction *act = 0; - const QString spacer = " "; menu->addSeparator(); @@ -1858,7 +1856,7 @@ QMenu *WatchModel::createFormatMenu(WatchItem *item) for (int format : alternativeFormats) { addCheckableAction(menu, spacer + nameForFormat(format), true, format == individualFormat, - [this, act, format, iname] { + [this, format, iname] { setIndividualFormat(iname, format); m_engine->updateLocals(); }); @@ -1878,7 +1876,7 @@ QMenu *WatchModel::createFormatMenu(WatchItem *item) for (int format : alternativeFormats) { addCheckableAction(menu, spacer + nameForFormat(format), true, format == typeFormat, - [this, act, format, item] { + [this, format, item] { setTypeFormat(item->type, format); m_engine->updateLocals(); }); @@ -2094,7 +2092,7 @@ void WatchHandler::notifyUpdateStarted(const UpdateParameters &updateParameters) void WatchHandler::notifyUpdateFinished() { QList<WatchItem *> toRemove; - m_model->forSelectedItems([this, &toRemove](WatchItem *item) { + m_model->forSelectedItems([&toRemove](WatchItem *item) { if (item->outdated) { toRemove.append(item); return false; diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index 8a4f0af3de..a0fc7c47a2 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -82,7 +82,7 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error) #ifdef CPP_ENABLED IWizardFactory::registerFactoryCreator( - [this]() -> QList<IWizardFactory *> { + []() -> QList<IWizardFactory *> { IWizardFactory *wizard = new FormClassWizard; wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT)); wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT)); diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index ae1c324c30..8deea9816d 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -694,7 +694,7 @@ void GitClient::diffFiles(const QString &workingDirectory, + QLatin1String(".DiffFiles.") + workingDirectory; requestReload(documentId, workingDirectory, tr("Git Diff Files"), - [this, workingDirectory, stagedFileNames, unstagedFileNames] + [workingDirectory, stagedFileNames, unstagedFileNames] (IDocument *doc) -> DiffEditorController* { return new FileListDiffController(doc, workingDirectory, stagedFileNames, unstagedFileNames); @@ -707,7 +707,7 @@ void GitClient::diffProject(const QString &workingDirectory, const QString &proj + QLatin1String(".DiffProject.") + workingDirectory; requestReload(documentId, workingDirectory, tr("Git Diff Project"), - [this, workingDirectory, projectDirectory] + [workingDirectory, projectDirectory] (IDocument *doc) -> DiffEditorController* { return new ProjectDiffController(doc, workingDirectory, {projectDirectory}); }); @@ -719,7 +719,7 @@ void GitClient::diffRepository(const QString &workingDirectory) + QLatin1String(".DiffRepository.") + workingDirectory; requestReload(documentId, workingDirectory, tr("Git Diff Repository"), - [this, workingDirectory](IDocument *doc) -> DiffEditorController* { + [workingDirectory](IDocument *doc) -> DiffEditorController* { return new RepositoryDiffController(doc, workingDirectory); }); } @@ -731,7 +731,7 @@ void GitClient::diffFile(const QString &workingDirectory, const QString &fileNam const QString documentId = QLatin1String(Constants::GIT_PLUGIN) + QLatin1String(".DifFile.") + sourceFile; requestReload(documentId, sourceFile, title, - [this, workingDirectory, fileName] + [workingDirectory, fileName] (IDocument *doc) -> DiffEditorController* { return new FileDiffController(doc, workingDirectory, fileName); }); @@ -744,7 +744,7 @@ void GitClient::diffBranch(const QString &workingDirectory, const QString documentId = QLatin1String(Constants::GIT_PLUGIN) + QLatin1String(".DiffBranch.") + branchName; requestReload(documentId, workingDirectory, title, - [this, workingDirectory, branchName] + [workingDirectory, branchName] (IDocument *doc) -> DiffEditorController* { return new BranchDiffController(doc, workingDirectory, branchName); }); @@ -851,7 +851,7 @@ void GitClient::show(const QString &source, const QString &id, const QString &na const QString documentId = QLatin1String(Constants::GIT_PLUGIN) + QLatin1String(".Show.") + id; requestReload(documentId, source, title, - [this, workingDirectory, id] + [workingDirectory, id] (IDocument *doc) -> DiffEditorController* { return new ShowController(doc, workingDirectory, id); }); @@ -1768,7 +1768,7 @@ bool GitClient::cleanList(const QString &workingDirectory, const QString &module const QString relativeBase = modulePath.isEmpty() ? QString() : modulePath + '/'; const QString prefix = "Would remove "; const QStringList removeLines = Utils::filtered( - splitLines(resp.stdOut()), [&prefix](const QString &s) { + splitLines(resp.stdOut()), [](const QString &s) { return s.startsWith("Would remove "); }); *files = Utils::transform(removeLines, [&relativeBase, &prefix](const QString &s) -> QString { diff --git a/src/plugins/imageviewer/imageviewerplugin.cpp b/src/plugins/imageviewer/imageviewerplugin.cpp index 6d1419da44..6a453eb90e 100644 --- a/src/plugins/imageviewer/imageviewerplugin.cpp +++ b/src/plugins/imageviewer/imageviewerplugin.cpp @@ -64,56 +64,56 @@ void ImageViewerPlugin::extensionsInitialized() { QAction *a = registerNewAction(Constants::ACTION_ZOOM_IN, tr("Zoom In"), QKeySequence(tr("Ctrl++"))); - connect(a, &QAction::triggered, this, [this]() { + connect(a, &QAction::triggered, this, []() { if (ImageViewer *iv = currentImageViewer()) iv->zoomIn(); }); a = registerNewAction(Constants::ACTION_ZOOM_OUT, tr("Zoom Out"), QKeySequence(tr("Ctrl+-"))); - connect(a, &QAction::triggered, this, [this]() { + connect(a, &QAction::triggered, this, []() { if (ImageViewer *iv = currentImageViewer()) iv->zoomOut(); }); a = registerNewAction(Constants::ACTION_ORIGINAL_SIZE, tr("Original Size"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+0") : tr("Ctrl+0"))); - connect(a, &QAction::triggered, this, [this]() { + connect(a, &QAction::triggered, this, []() { if (ImageViewer *iv = currentImageViewer()) iv->resetToOriginalSize(); }); a = registerNewAction(Constants::ACTION_FIT_TO_SCREEN, tr("Fit to Screen"), QKeySequence(tr("Ctrl+="))); - connect(a, &QAction::triggered, this, [this]() { + connect(a, &QAction::triggered, this, []() { if (ImageViewer *iv = currentImageViewer()) iv->fitToScreen(); }); a = registerNewAction(Constants::ACTION_BACKGROUND, tr("Switch Background"), QKeySequence(tr("Ctrl+["))); - connect(a, &QAction::triggered, this, [this]() { + connect(a, &QAction::triggered, this, []() { if (ImageViewer *iv = currentImageViewer()) iv->switchViewBackground(); }); a = registerNewAction(Constants::ACTION_OUTLINE, tr("Switch Outline"), QKeySequence(tr("Ctrl+]"))); - connect(a, &QAction::triggered, this, [this]() { + connect(a, &QAction::triggered, this, []() { if (ImageViewer *iv = currentImageViewer()) iv->switchViewOutline(); }); a = registerNewAction(Constants::ACTION_TOGGLE_ANIMATION, tr("Toggle Animation"), QKeySequence()); - connect(a, &QAction::triggered, this, [this]() { + connect(a, &QAction::triggered, this, []() { if (ImageViewer *iv = currentImageViewer()) iv->togglePlay(); }); a = registerNewAction(Constants::ACTION_EXPORT_IMAGE, tr("Export Image"), QKeySequence()); - connect(a, &QAction::triggered, this, [this]() { + connect(a, &QAction::triggered, this, []() { if (ImageViewer *iv = currentImageViewer()) iv->exportImage(); }); diff --git a/src/plugins/ios/iossettingswidget.cpp b/src/plugins/ios/iossettingswidget.cpp index 6e99dadca2..0cb54bd28b 100644 --- a/src/plugins/ios/iossettingswidget.cpp +++ b/src/plugins/ios/iossettingswidget.cpp @@ -148,7 +148,7 @@ void IosSettingsWidget::onCreate() QPointer<SimulatorOperationDialog> statusDialog = new SimulatorOperationDialog(this); statusDialog->setAttribute(Qt::WA_DeleteOnClose); statusDialog->addMessage(tr("Creating simulator device..."), Utils::NormalMessageFormat); - const auto onSimulatorCreate = [this, statusDialog](const QString &name, + const auto onSimulatorCreate = [statusDialog](const QString &name, const SimulatorControl::ResponseData &response) { if (response.success) { statusDialog->addMessage(tr("Simulator device (%1) created.\nUDID: %2") diff --git a/src/plugins/modeleditor/editordiagramview.cpp b/src/plugins/modeleditor/editordiagramview.cpp index 9a42e05364..5e2fe5b65e 100644 --- a/src/plugins/modeleditor/editordiagramview.cpp +++ b/src/plugins/modeleditor/editordiagramview.cpp @@ -49,7 +49,7 @@ EditorDiagramView::EditorDiagramView(QWidget *parent) { auto droputils = new Utils::DropSupport( this, - [this](QDropEvent *event, Utils::DropSupport *dropSupport) + [](QDropEvent *event, Utils::DropSupport *dropSupport) -> bool { return dropSupport->isValueDrop(event); }); connect(droputils, &Utils::DropSupport::valuesDropped, this, &EditorDiagramView::dropProjectExplorerNodes); diff --git a/src/plugins/projectexplorer/extracompiler.cpp b/src/plugins/projectexplorer/extracompiler.cpp index 59fd6b9675..ab02000440 100644 --- a/src/plugins/projectexplorer/extracompiler.cpp +++ b/src/plugins/projectexplorer/extracompiler.cpp @@ -381,13 +381,13 @@ ProcessExtraCompiler::~ProcessExtraCompiler() void ProcessExtraCompiler::run(const QByteArray &sourceContents) { - ContentProvider contents = [this, sourceContents]() { return sourceContents; }; + ContentProvider contents = [sourceContents]() { return sourceContents; }; runImpl(contents); } void ProcessExtraCompiler::run(const Utils::FileName &fileName) { - ContentProvider contents = [this, fileName]() { + ContentProvider contents = [fileName]() { QFile file(fileName.toString()); if (!file.open(QFile::ReadOnly | QFile::Text)) return QByteArray(); diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index f340f086dc..09a46646ee 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -101,7 +101,7 @@ KitInformation::ItemList SysRootKitInformation::toUserOutput(const Kit *k) const void SysRootKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const { - expander->registerFileVariables("SysRoot", tr("Sys Root"), [this, kit]() -> QString { + expander->registerFileVariables("SysRoot", tr("Sys Root"), [kit]() -> QString { return SysRootKitInformation::sysRoot(kit).toString(); }); } @@ -335,24 +335,24 @@ void ToolChainKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander { // Compatibility with Qt Creator < 4.2: expander->registerVariable("Compiler:Name", tr("Compiler"), - [this, kit]() -> QString { + [kit]() -> QString { const ToolChain *tc = toolChain(kit, Constants::CXX_LANGUAGE_ID); return tc ? tc->displayName() : tr("None"); }); expander->registerVariable("Compiler:Executable", tr("Path to the compiler executable"), - [this, kit]() -> QString { + [kit]() -> QString { const ToolChain *tc = toolChain(kit, Constants::CXX_LANGUAGE_ID); return tc ? tc->compilerCommand().toString() : QString(); }); expander->registerPrefix("Compiler:Name", tr("Compiler for different languages"), - [this, kit](const QString &ls) -> QString { + [kit](const QString &ls) -> QString { const ToolChain *tc = toolChain(kit, findLanguage(ls)); return tc ? tc->displayName() : tr("None"); }); expander->registerPrefix("Compiler:Executable", tr("Compiler executable for different languages"), - [this, kit](const QString &ls) -> QString { + [kit](const QString &ls) -> QString { const ToolChain *tc = toolChain(kit, findLanguage(ls)); return tc ? tc->compilerCommand().toString() : QString(); }); @@ -518,7 +518,7 @@ void ToolChainKitInformation::kitsWereLoaded() void ToolChainKitInformation::toolChainUpdated(ToolChain *tc) { - for (Kit *k : KitManager::kits([tc, this](const Kit *k) { return toolChain(k, tc->language()) == tc; })) + for (Kit *k : KitManager::kits([tc](const Kit *k) { return toolChain(k, tc->language()) == tc; })) notifyAboutUpdate(k); } @@ -691,27 +691,27 @@ KitInformation::ItemList DeviceKitInformation::toUserOutput(const Kit *k) const void DeviceKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const { expander->registerVariable("Device:HostAddress", tr("Host address"), - [this, kit]() -> QString { + [kit]() -> QString { const IDevice::ConstPtr device = DeviceKitInformation::device(kit); return device ? device->sshParameters().host : QString(); }); expander->registerVariable("Device:SshPort", tr("SSH port"), - [this, kit]() -> QString { + [kit]() -> QString { const IDevice::ConstPtr device = DeviceKitInformation::device(kit); return device ? QString::number(device->sshParameters().port) : QString(); }); expander->registerVariable("Device:UserName", tr("User name"), - [this, kit]() -> QString { + [kit]() -> QString { const IDevice::ConstPtr device = DeviceKitInformation::device(kit); return device ? device->sshParameters().userName : QString(); }); expander->registerVariable("Device:KeyFile", tr("Private key file"), - [this, kit]() -> QString { + [kit]() -> QString { const IDevice::ConstPtr device = DeviceKitInformation::device(kit); return device ? device->sshParameters().privateKeyFile : QString(); }); expander->registerVariable("Device:Name", tr("Device name"), - [this, kit]() -> QString { + [kit]() -> QString { const IDevice::ConstPtr device = DeviceKitInformation::device(kit); return device ? device->displayName() : QString(); }); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 726420e0bf..6f7652cc22 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -238,7 +238,6 @@ const char G_BUILD_CANCEL[] = "ProjectExplorer.Group.BuildCancel"; const char RUNMENUCONTEXTMENU[] = "Project.RunMenu"; const char FOLDER_OPEN_LOCATIONS_CONTEXT_MENU[] = "Project.F.OpenLocation.CtxMenu"; const char PROJECT_OPEN_LOCATIONS_CONTEXT_MENU[] = "Project.P.OpenLocation.CtxMenu"; -const char SUBPROJECT_OPEN_LOCATIONS_CONTEXT_MENU[] = "Project.S.OpenLocation.CtxMenu"; } // namespace Constants @@ -616,7 +615,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er addAutoReleasedObject(new ConfigTaskHandler(Task::compilerMissingTask(), Constants::KITS_SETTINGS_PAGE_ID)); - ICore::addPreCloseListener([this]() -> bool { return coreAboutToClose(); }); + ICore::addPreCloseListener([]() -> bool { return coreAboutToClose(); }); dd->m_outputPane = new AppOutputPane; addAutoReleasedObject(dd->m_outputPane); @@ -1193,7 +1192,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er connect(ICore::instance(), &ICore::saveSettingsRequested, dd, &ProjectExplorerPluginPrivate::savePersistentSettings); - connect(EditorManager::instance(), &EditorManager::autoSaved, this, [this] { + connect(EditorManager::instance(), &EditorManager::autoSaved, this, [] { if (!dd->m_shuttingDown && !SessionManager::loadingSession()) SessionManager::save(); }); @@ -1267,79 +1266,78 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er dd, &ProjectExplorerPlugin::openNewProjectDialog); connect(dd->m_loadAction, &QAction::triggered, dd, &ProjectExplorerPluginPrivate::loadAction); - connect(dd->m_buildProjectOnlyAction, &QAction::triggered, dd, [this] { + connect(dd->m_buildProjectOnlyAction, &QAction::triggered, dd, [] { dd->queue({ SessionManager::startupProject() }, { Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_buildAction, &QAction::triggered, - dd, [this] { + connect(dd->m_buildAction, &QAction::triggered, dd, [] { dd->queue(SessionManager::projectOrder(SessionManager::startupProject()), { Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_buildActionContextMenu, &QAction::triggered, dd, [this] { + connect(dd->m_buildActionContextMenu, &QAction::triggered, dd, [] { dd->queue({ ProjectTree::currentProject() }, { Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_buildDependenciesActionContextMenu, &QAction::triggered, dd, [this] { + connect(dd->m_buildDependenciesActionContextMenu, &QAction::triggered, dd, [] { dd->queue(SessionManager::projectOrder(ProjectTree::currentProject()), { Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_buildSessionAction, &QAction::triggered, dd, [this] { + connect(dd->m_buildSessionAction, &QAction::triggered, dd, [] { dd->queue(SessionManager::projectOrder(), { Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_rebuildProjectOnlyAction, &QAction::triggered, dd, [this] { + connect(dd->m_rebuildProjectOnlyAction, &QAction::triggered, dd, [] { dd->queue({ SessionManager::startupProject() }, { Id(Constants::BUILDSTEPS_CLEAN), Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_rebuildAction, &QAction::triggered, dd, [this] { + connect(dd->m_rebuildAction, &QAction::triggered, dd, [] { dd->queue(SessionManager::projectOrder(SessionManager::startupProject()), { Id(Constants::BUILDSTEPS_CLEAN), Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_rebuildActionContextMenu, &QAction::triggered, dd, [this] { + connect(dd->m_rebuildActionContextMenu, &QAction::triggered, dd, [] { dd->queue({ ProjectTree::currentProject() }, { Id(Constants::BUILDSTEPS_CLEAN), Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_rebuildDependenciesActionContextMenu, &QAction::triggered, dd, [this] { + connect(dd->m_rebuildDependenciesActionContextMenu, &QAction::triggered, dd, [] { dd->queue(SessionManager::projectOrder(ProjectTree::currentProject()), { Id(Constants::BUILDSTEPS_CLEAN), Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_rebuildSessionAction, &QAction::triggered, dd, [this] { + connect(dd->m_rebuildSessionAction, &QAction::triggered, dd, [] { dd->queue(SessionManager::projectOrder(), { Id(Constants::BUILDSTEPS_CLEAN), Id(Constants::BUILDSTEPS_BUILD) }); }); - connect(dd->m_deployProjectOnlyAction, &QAction::triggered, dd, [this] { + connect(dd->m_deployProjectOnlyAction, &QAction::triggered, dd, [] { dd->deploy({ SessionManager::startupProject() }); }); - connect(dd->m_deployAction, &QAction::triggered, dd, [this] { + connect(dd->m_deployAction, &QAction::triggered, dd, [] { dd->deploy(SessionManager::projectOrder(SessionManager::startupProject())); }); - connect(dd->m_deployActionContextMenu, &QAction::triggered, dd, [this] { + connect(dd->m_deployActionContextMenu, &QAction::triggered, dd, [] { dd->deploy({ ProjectTree::currentProject() }); }); - connect(dd->m_deploySessionAction, &QAction::triggered, dd, [this] { + connect(dd->m_deploySessionAction, &QAction::triggered, dd, [] { dd->deploy(SessionManager::projectOrder()); }); - connect(dd->m_cleanProjectOnlyAction, &QAction::triggered, dd, [this] { + connect(dd->m_cleanProjectOnlyAction, &QAction::triggered, dd, [] { dd->queue({ SessionManager::startupProject() }, { Id(Constants::BUILDSTEPS_CLEAN) }); }); - connect(dd->m_cleanAction, &QAction::triggered, dd, [this] { + connect(dd->m_cleanAction, &QAction::triggered, dd, [] { dd->queue(SessionManager::projectOrder(SessionManager::startupProject()), { Id(Constants::BUILDSTEPS_CLEAN) }); }); - connect(dd->m_cleanActionContextMenu, &QAction::triggered, dd, [this] { + connect(dd->m_cleanActionContextMenu, &QAction::triggered, dd, [] { dd->queue({ ProjectTree::currentProject() }, { Id(Constants::BUILDSTEPS_CLEAN) }); }); - connect(dd->m_cleanDependenciesActionContextMenu, &QAction::triggered, dd, [this] { + connect(dd->m_cleanDependenciesActionContextMenu, &QAction::triggered, dd, [] { dd->queue(SessionManager::projectOrder(ProjectTree::currentProject()), { Id(Constants::BUILDSTEPS_CLEAN) }); }); - connect(dd->m_cleanSessionAction, &QAction::triggered, dd, [this] { + connect(dd->m_cleanSessionAction, &QAction::triggered, dd, [] { dd->queue(SessionManager::projectOrder(), { Id(Constants::BUILDSTEPS_CLEAN) }); }); connect(dd->m_runAction, &QAction::triggered, - dd, [this]() { m_instance->runStartupProject(Constants::NORMAL_RUN_MODE); }); + dd, []() { m_instance->runStartupProject(Constants::NORMAL_RUN_MODE); }); connect(dd->m_runActionContextMenu, &QAction::triggered, dd, &ProjectExplorerPluginPrivate::runProjectContextMenu); connect(dd->m_runWithoutDeployAction, &QAction::triggered, - dd, [this]() { m_instance->runStartupProject(Constants::NORMAL_RUN_MODE, true); }); + dd, []() { m_instance->runStartupProject(Constants::NORMAL_RUN_MODE, true); }); connect(dd->m_cancelBuildAction, &QAction::triggered, BuildManager::instance(), &BuildManager::cancel); connect(dd->m_unloadAction, &QAction::triggered, @@ -1397,7 +1395,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er Utils::MacroExpander *expander = Utils::globalMacroExpander(); expander->registerFileVariables(Constants::VAR_CURRENTPROJECT_PREFIX, tr("Current project's main file."), - [this]() -> QString { + []() -> QString { Utils::FileName projectFilePath; if (Project *project = ProjectTree::currentProject()) projectFilePath = project->projectFilePath(); @@ -1413,7 +1411,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er expander->registerVariable(Constants::VAR_CURRENTPROJECT_NAME, tr("The name of the current project."), - [this]() -> QString { + []() -> QString { Project *project = ProjectTree::currentProject(); return project ? project->displayName() : QString(); }); @@ -1482,7 +1480,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er expander->registerVariable(Constants::VAR_CURRENTRUN_NAME, tr("The currently active run configuration's name."), - [this]() -> QString { + []() -> QString { if (Target *target = activeTarget()) { if (RunConfiguration *rc = target->activeRunConfiguration()) return rc->displayName(); @@ -1492,7 +1490,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er expander->registerFileVariables("CurrentRun:Executable", tr("The currently active run configuration's executable (if applicable)."), - [this]() -> QString { + []() -> QString { if (Target *target = activeTarget()) { if (RunConfiguration *rc = target->activeRunConfiguration()) { if (rc->runnable().is<StandardRunnable>()) @@ -1614,7 +1612,7 @@ void ProjectExplorerPlugin::extensionsInitialized() QStringList filterStrings; auto factory = new IDocumentFactory; - factory->setOpener([this](QString fileName) -> IDocument* { + factory->setOpener([](QString fileName) -> IDocument* { const QFileInfo fi(fileName); if (fi.isDir()) fileName = FolderNavigationWidget::projectFilesInDirectory(fi.absoluteFilePath()).value(0, fileName); diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 5bf7255a19..f22618a3c5 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -395,7 +395,7 @@ QMimeData *FlatModel::mimeData(const QModelIndexList &indexes) const WrapperNode *FlatModel::wrapperForNode(const Node *node) const { - return findNonRootItem([this, node](WrapperNode *item) { + return findNonRootItem([node](WrapperNode *item) { return item->m_node == node; }); } diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 1fe1cd42b5..f17c40a197 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -134,9 +134,9 @@ SessionManager::SessionManager(QObject *parent) : QObject(parent) connect(this, &SessionManager::projectDisplayNameChanged, EditorManager::instance(), &EditorManager::updateWindowTitles); connect(EditorManager::instance(), &EditorManager::editorOpened, - [this] { markSessionFileDirty(); }); + this, [] { markSessionFileDirty(); }); connect(EditorManager::instance(), &EditorManager::editorsClosed, - [this] { markSessionFileDirty(); }); + this, [] { markSessionFileDirty(); }); EditorManager::setWindowTitleAdditionHandler(&SessionManagerPrivate::windowTitleAddition); EditorManager::setSessionTitleHandler(&SessionManagerPrivate::sessionTitle); diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index c089109fda..955cedc956 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -423,7 +423,7 @@ public: QAction *disableAction = menu->addAction(tr("Disable Kit \"%1\" for Project \"%2\"").arg(kitName, projectName)); disableAction->setEnabled(m_kitId.isValid() && isEnabled()); - QObject::connect(disableAction, &QAction::triggered, [this, kit] { + QObject::connect(disableAction, &QAction::triggered, m_project, [this] { Target *t = target(); QTC_ASSERT(t, return); QString kitName = t->displayName(); @@ -767,7 +767,7 @@ TargetItem *TargetGroupItem::targetItem(Target *target) const { if (target) { Id needle = target->id(); // Unconfigured project have no active target. - return findFirstLevelChild([this, needle](TargetItem *item) { return item->m_kitId == needle; }); + return findFirstLevelChild([needle](TargetItem *item) { return item->m_kitId == needle; }); } return 0; } diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index 268b01dbc2..57550e2e52 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -85,7 +85,8 @@ void QmakeKitInformation::setup(Kit *k) ToolChain *tc = ToolChainKitInformation::toolChain(k, Constants::CXX_LANGUAGE_ID); if (!tc || (!tc->suggestedMkspecList().empty() && !tc->suggestedMkspecList().contains(spec))) { - const QList<ToolChain *> possibleTcs = ToolChainManager::toolChains([version, &spec](const ToolChain *t) { + const QList<ToolChain *> possibleTcs = ToolChainManager::toolChains( + [version](const ToolChain *t) { return t->isValid() && t->language() == Core::Id(Constants::CXX_LANGUAGE_ID) && version->qtAbis().contains(t->targetAbi()); @@ -113,7 +114,7 @@ KitInformation::ItemList QmakeKitInformation::toUserOutput(const Kit *k) const void QmakeKitInformation::addToMacroExpander(Kit *kit, MacroExpander *expander) const { expander->registerVariable("Qmake:mkspec", tr("Mkspec configured for qmake by the Kit."), - [this, kit]() -> QString { + [kit]() -> QString { return QmakeKitInformation::mkspec(kit).toUserOutput(); }); } diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp index 145a622954..9bf3dee51d 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp @@ -98,7 +98,7 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc) this, &QmakeProjectConfigWidget::shadowBuildEdited); QmakeProject *project = static_cast<QmakeProject *>(bc->target()->project()); - project->subscribeSignal(&BuildConfiguration::environmentChanged, this, [this, bc]() { + project->subscribeSignal(&BuildConfiguration::environmentChanged, this, [this]() { if (static_cast<BuildConfiguration *>(sender())->isActive()) environmentChanged(); }); diff --git a/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp b/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp index 812f49f9f5..e365918586 100644 --- a/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp +++ b/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp @@ -92,7 +92,7 @@ QWidget *ChangeStyleWidgetAction::createWidget(QWidget *parent) connect(comboBox, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated), this, - [comboBox, this](const QString &style) { + [this](const QString &style) { if (style.isEmpty()) return; diff --git a/src/plugins/qmldesigner/openuiqmlfiledialog.cpp b/src/plugins/qmldesigner/openuiqmlfiledialog.cpp index 75837654dc..545719623f 100644 --- a/src/plugins/qmldesigner/openuiqmlfiledialog.cpp +++ b/src/plugins/qmldesigner/openuiqmlfiledialog.cpp @@ -55,7 +55,7 @@ OpenUiQmlFileDialog::OpenUiQmlFileDialog(QWidget *parent) : } close(); }); - connect(ui->checkBox, &QCheckBox::toggled, [this](bool b){ + connect(ui->checkBox, &QCheckBox::toggled, this, [](bool b){ DesignerSettings settings = QmlDesignerPlugin::instance()->settings(); settings.insert(DesignerSettingsKey::WARNING_FOR_QML_FILES_INSTEAD_OF_UIQML_FILES, !b); QmlDesignerPlugin::instance()->setSettings(settings); diff --git a/src/plugins/qmldesigner/shortcutmanager.cpp b/src/plugins/qmldesigner/shortcutmanager.cpp index 864d4046f4..8b45efc853 100644 --- a/src/plugins/qmldesigner/shortcutmanager.cpp +++ b/src/plugins/qmldesigner/shortcutmanager.cpp @@ -175,7 +175,7 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex //Close All Others Action Core::ActionManager::registerAction(&m_closeOtherEditorsAction, Core::Constants::CLOSEOTHERS, qmlDesignerMainContext); - connect(&m_closeOtherEditorsAction, &QAction::triggered, em, [em] { + connect(&m_closeOtherEditorsAction, &QAction::triggered, em, [] { Core::EditorManager::closeOtherDocuments(); }); diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp index bf1dc40d80..2b476e1b2f 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp @@ -554,12 +554,12 @@ void QmlProfilerModelManager::save(const QString &filename) emit error(message); }, Qt::QueuedConnection); - connect(writer, &QmlProfilerFileWriter::success, this, [this, file]() { + connect(writer, &QmlProfilerFileWriter::success, this, [file]() { file->close(); delete file; }, Qt::QueuedConnection); - connect(writer, &QmlProfilerFileWriter::canceled, this, [this, file]() { + connect(writer, &QmlProfilerFileWriter::canceled, this, [file]() { file->close(); file->remove(); delete file; diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp index bcbb55c472..d18514eb88 100644 --- a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp @@ -104,7 +104,7 @@ void QmlProfilerPlugin::extensionsInitialized() }; RunControl::registerWorkerCreator(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, - [this](RunControl *runControl) { return new QmlProfilerRunner(runControl); }); + [](RunControl *runControl) { return new QmlProfilerRunner(runControl); }); RunControl::registerWorker<LocalQmlProfilerSupport> (ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, constraint); diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index 93997c901e..972df564a8 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -126,18 +126,18 @@ ProjectExplorer::IOutputParser *QtKitInformation::createOutputParser(const Proje void QtKitInformation::addToMacroExpander(Kit *kit, MacroExpander *expander) const { expander->registerSubProvider( - [this, kit]() -> MacroExpander * { + [kit]() -> MacroExpander * { BaseQtVersion *version = qtVersion(kit); return version ? version->macroExpander() : 0; }); expander->registerVariable("Qt:Name", tr("Name of Qt Version"), - [this, kit]() -> QString { + [kit]() -> QString { BaseQtVersion *version = qtVersion(kit); return version ? version->displayName() : tr("unknown"); }); expander->registerVariable("Qt:qmakeExecutable", tr("Path to the qmake executable"), - [this, kit]() -> QString { + [kit]() -> QString { BaseQtVersion *version = qtVersion(kit); return version ? version->qmakeCommand().toString() : QString(); }); diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index 0622f29f10..e536eba6f4 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -248,7 +248,7 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason, } case IAssistProvider::Asynchronous: { processor->setAsyncCompletionAvailableHandler( - [this, processor, reason](IAssistProposal *newProposal){ + [this, reason](IAssistProposal *newProposal){ QTC_CHECK(newProposal); invalidateCurrentRequestData(); displayProposal(newProposal, reason); diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index cb2515acec..35c7d5e285 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -214,18 +214,18 @@ void TextEditorActionHandlerPrivate::createActions() using namespace TextEditor::Constants; m_undoAction = registerAction(UNDO, - [this] (TextEditorWidget *w) { w->undo(); }, true, tr("&Undo")); + [] (TextEditorWidget *w) { w->undo(); }, true, tr("&Undo")); m_redoAction = registerAction(REDO, - [this] (TextEditorWidget *w) { w->redo(); }, true, tr("&Redo")); + [] (TextEditorWidget *w) { w->redo(); }, true, tr("&Redo")); m_copyAction = registerAction(COPY, - [this] (TextEditorWidget *w) { w->copy(); }, true); + [] (TextEditorWidget *w) { w->copy(); }, true); m_cutAction = registerAction(CUT, - [this] (TextEditorWidget *w) { w->cut(); }, true); + [] (TextEditorWidget *w) { w->cut(); }, true); m_pasteAction = registerAction(PASTE, - [this] (TextEditorWidget *w) { w->paste(); }, true); + [] (TextEditorWidget *w) { w->paste(); }, true); m_selectAllAction = registerAction(SELECTALL, - [this] (TextEditorWidget *w) { w->selectAll(); }, true); - m_gotoAction = registerAction(GOTO, [this] (TextEditorWidget *) { + [] (TextEditorWidget *w) { w->selectAll(); }, true); + m_gotoAction = registerAction(GOTO, [] (TextEditorWidget *) { QString locatorString = TextEditorPlugin::lineNumberFilter()->shortcutString(); locatorString += QLatin1Char(' '); const int selectionStart = locatorString.size(); @@ -233,101 +233,101 @@ void TextEditorActionHandlerPrivate::createActions() Core::LocatorManager::show(locatorString, selectionStart, locatorString.size() - selectionStart); }); m_printAction = registerAction(PRINT, - [this] (TextEditorWidget *widget) { widget->print(Core::ICore::printer()); }); + [] (TextEditorWidget *widget) { widget->print(Core::ICore::printer()); }); m_deleteLineAction = registerAction(DELETE_LINE, - [this] (TextEditorWidget *w) { w->deleteLine(); }, true, tr("Delete &Line")); + [] (TextEditorWidget *w) { w->deleteLine(); }, true, tr("Delete &Line")); m_deleteEndOfLineAction = registerAction(DELETE_END_OF_LINE, - [this] (TextEditorWidget *w) { w->deleteEndOfLine(); }, true, tr("Delete Line from Cursor On")); + [] (TextEditorWidget *w) { w->deleteEndOfLine(); }, true, tr("Delete Line from Cursor On")); m_deleteEndOfWordAction = registerAction(DELETE_END_OF_WORD, - [this] (TextEditorWidget *w) { w->deleteEndOfWord(); }, true, tr("Delete Word from Cursor On")); + [] (TextEditorWidget *w) { w->deleteEndOfWord(); }, true, tr("Delete Word from Cursor On")); m_deleteEndOfWordCamelCaseAction = registerAction(DELETE_END_OF_WORD_CAMEL_CASE, - [this] (TextEditorWidget *w) { w->deleteEndOfWordCamelCase(); }, true, tr("Delete Word Camel Case from Cursor On")); + [] (TextEditorWidget *w) { w->deleteEndOfWordCamelCase(); }, true, tr("Delete Word Camel Case from Cursor On")); m_deleteStartOfLineAction = registerAction(DELETE_START_OF_LINE, - [this] (TextEditorWidget *w) { w->deleteStartOfLine(); }, true, tr("Delete Line up to Cursor")); + [] (TextEditorWidget *w) { w->deleteStartOfLine(); }, true, tr("Delete Line up to Cursor")); m_deleteStartOfWordAction = registerAction(DELETE_START_OF_WORD, - [this] (TextEditorWidget *w) { w->deleteStartOfWord(); }, true, tr("Delete Word up to Cursor")); + [] (TextEditorWidget *w) { w->deleteStartOfWord(); }, true, tr("Delete Word up to Cursor")); m_deleteStartOfWordCamelCaseAction = registerAction(DELETE_START_OF_WORD_CAMEL_CASE, - [this] (TextEditorWidget *w) { w->deleteStartOfWordCamelCase(); }, true, tr("Delete Word Camel Case up to Cursor")); + [] (TextEditorWidget *w) { w->deleteStartOfWordCamelCase(); }, true, tr("Delete Word Camel Case up to Cursor")); m_gotoBlockStartWithSelectionAction = registerAction(GOTO_BLOCK_START_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoBlockStartWithSelection(); }, true, tr("Go to Block Start with Selection"), + [] (TextEditorWidget *w) { w->gotoBlockStartWithSelection(); }, true, tr("Go to Block Start with Selection"), QKeySequence(tr("Ctrl+{"))); m_gotoBlockEndWithSelectionAction = registerAction(GOTO_BLOCK_END_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoBlockEndWithSelection(); }, true, tr("Go to Block End with Selection"), + [] (TextEditorWidget *w) { w->gotoBlockEndWithSelection(); }, true, tr("Go to Block End with Selection"), QKeySequence(tr("Ctrl+}"))); m_moveLineUpAction = registerAction(MOVE_LINE_UP, - [this] (TextEditorWidget *w) { w->moveLineUp(); }, true, tr("Move Line Up"), + [] (TextEditorWidget *w) { w->moveLineUp(); }, true, tr("Move Line Up"), QKeySequence(tr("Ctrl+Shift+Up"))); m_moveLineDownAction = registerAction(MOVE_LINE_DOWN, - [this] (TextEditorWidget *w) { w->moveLineDown(); }, true, tr("Move Line Down"), + [] (TextEditorWidget *w) { w->moveLineDown(); }, true, tr("Move Line Down"), QKeySequence(tr("Ctrl+Shift+Down"))); m_copyLineUpAction = registerAction(COPY_LINE_UP, - [this] (TextEditorWidget *w) { w->copyLineUp(); }, true, tr("Copy Line Up"), + [] (TextEditorWidget *w) { w->copyLineUp(); }, true, tr("Copy Line Up"), QKeySequence(tr("Ctrl+Alt+Up"))); m_copyLineDownAction = registerAction(COPY_LINE_DOWN, - [this] (TextEditorWidget *w) { w->copyLineDown(); }, true, tr("Copy Line Down"), + [] (TextEditorWidget *w) { w->copyLineDown(); }, true, tr("Copy Line Down"), QKeySequence(tr("Ctrl+Alt+Down"))); m_joinLinesAction = registerAction(JOIN_LINES, - [this] (TextEditorWidget *w) { w->joinLines(); }, true, tr("Join Lines"), + [] (TextEditorWidget *w) { w->joinLines(); }, true, tr("Join Lines"), QKeySequence(tr("Ctrl+J"))); m_insertLineAboveAction = registerAction(INSERT_LINE_ABOVE, - [this] (TextEditorWidget *w) { w->insertLineAbove(); }, true, tr("Insert Line Above Current Line"), + [] (TextEditorWidget *w) { w->insertLineAbove(); }, true, tr("Insert Line Above Current Line"), QKeySequence(tr("Ctrl+Shift+Return"))); m_insertLineBelowAction = registerAction(INSERT_LINE_BELOW, - [this] (TextEditorWidget *w) { w->insertLineBelow(); }, true, tr("Insert Line Below Current Line"), + [] (TextEditorWidget *w) { w->insertLineBelow(); }, true, tr("Insert Line Below Current Line"), QKeySequence(tr("Ctrl+Return"))); m_switchUtf8bomAction = registerAction(SWITCH_UTF8BOM, - [this] (TextEditorWidget *w) { w->switchUtf8bom(); }, true, tr("Toggle UTF-8 BOM")); + [] (TextEditorWidget *w) { w->switchUtf8bom(); }, true, tr("Toggle UTF-8 BOM")); m_indentAction = registerAction(INDENT, - [this] (TextEditorWidget *w) { w->indent(); }, true, tr("Indent")); + [] (TextEditorWidget *w) { w->indent(); }, true, tr("Indent")); m_unindentAction = registerAction(UNINDENT, - [this] (TextEditorWidget *w) { w->unindent(); }, true, tr("Unindent")); + [] (TextEditorWidget *w) { w->unindent(); }, true, tr("Unindent")); m_followSymbolAction = registerAction(FOLLOW_SYMBOL_UNDER_CURSOR, - [this] (TextEditorWidget *w) { w->openLinkUnderCursor(); }, true, tr("Follow Symbol Under Cursor"), + [] (TextEditorWidget *w) { w->openLinkUnderCursor(); }, true, tr("Follow Symbol Under Cursor"), QKeySequence(Qt::Key_F2)); m_followSymbolInNextSplitAction = registerAction(FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT, - [this] (TextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, tr("Follow Symbol Under Cursor in Next Split"), + [] (TextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, tr("Follow Symbol Under Cursor in Next Split"), QKeySequence(Utils::HostOsInfo::isMacHost() ? tr("Meta+E, F2") : tr("Ctrl+E, F2"))); m_jumpToFileAction = registerAction(JUMP_TO_FILE_UNDER_CURSOR, - [this] (TextEditorWidget *w) { w->openLinkUnderCursor(); }, true, tr("Jump to File Under Cursor"), + [] (TextEditorWidget *w) { w->openLinkUnderCursor(); }, true, tr("Jump to File Under Cursor"), QKeySequence(Qt::Key_F2)); m_jumpToFileInNextSplitAction = registerAction(JUMP_TO_FILE_UNDER_CURSOR_IN_NEXT_SPLIT, - [this] (TextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, tr("Jump to File Under Cursor in Next Split"), + [] (TextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, tr("Jump to File Under Cursor in Next Split"), QKeySequence(Utils::HostOsInfo::isMacHost() ? tr("Meta+E, F2") : tr("Ctrl+E, F2")).toString()); m_viewPageUpAction = registerAction(VIEW_PAGE_UP, - [this] (TextEditorWidget *w) { w->viewPageUp(); }, true, tr("Move the View a Page Up and Keep the Cursor Position"), + [] (TextEditorWidget *w) { w->viewPageUp(); }, true, tr("Move the View a Page Up and Keep the Cursor Position"), QKeySequence(tr("Ctrl+PgUp"))); m_viewPageDownAction = registerAction(VIEW_PAGE_DOWN, - [this] (TextEditorWidget *w) { w->viewPageDown(); }, true, tr("Move the View a Page Down and Keep the Cursor Position"), + [] (TextEditorWidget *w) { w->viewPageDown(); }, true, tr("Move the View a Page Down and Keep the Cursor Position"), QKeySequence(tr("Ctrl+PgDown"))); m_viewLineUpAction = registerAction(VIEW_LINE_UP, - [this] (TextEditorWidget *w) { w->viewLineUp(); }, true, tr("Move the View a Line Up and Keep the Cursor Position"), + [] (TextEditorWidget *w) { w->viewLineUp(); }, true, tr("Move the View a Line Up and Keep the Cursor Position"), QKeySequence(tr("Ctrl+Up"))); m_viewLineDownAction = registerAction(VIEW_LINE_DOWN, - [this] (TextEditorWidget *w) { w->viewLineDown(); }, true, tr("Move the View a Line Down and Keep the Cursor Position"), + [] (TextEditorWidget *w) { w->viewLineDown(); }, true, tr("Move the View a Line Down and Keep the Cursor Position"), QKeySequence(tr("Ctrl+Down"))); // register "Edit" Menu Actions Core::ActionContainer *editMenu = Core::ActionManager::actionContainer(M_EDIT); m_selectEncodingAction = registerAction(SELECT_ENCODING, - [this] (TextEditorWidget *w) { w->selectEncoding(); }, false, tr("Select Encoding..."), + [] (TextEditorWidget *w) { w->selectEncoding(); }, false, tr("Select Encoding..."), QKeySequence(), G_EDIT_OTHER, editMenu); m_circularPasteAction = registerAction(CIRCULAR_PASTE, - [this] (TextEditorWidget *w) { w->circularPaste(); }, false, tr("Paste from Clipboard History"), + [] (TextEditorWidget *w) { w->circularPaste(); }, false, tr("Paste from Clipboard History"), QKeySequence(tr("Ctrl+Shift+V")), G_EDIT_COPYPASTE, editMenu); // register "Edit -> Advanced" Menu Actions Core::ActionContainer *advancedEditMenu = Core::ActionManager::actionContainer(M_EDIT_ADVANCED); m_formatAction = registerAction(AUTO_INDENT_SELECTION, - [this] (TextEditorWidget *w) { w->format(); }, true, tr("Auto-&indent Selection"), + [] (TextEditorWidget *w) { w->format(); }, true, tr("Auto-&indent Selection"), QKeySequence(tr("Ctrl+I")), G_EDIT_FORMAT, advancedEditMenu); m_rewrapParagraphAction = registerAction(REWRAP_PARAGRAPH, - [this] (TextEditorWidget *w) { w->rewrapParagraph(); }, true, tr("&Rewrap Paragraph"), + [] (TextEditorWidget *w) { w->rewrapParagraph(); }, true, tr("&Rewrap Paragraph"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+E, R") : tr("Ctrl+E, R")), G_EDIT_FORMAT, advancedEditMenu); m_visualizeWhitespaceAction = registerBoolAction(VISUALIZE_WHITESPACE, - [this] (TextEditorWidget *widget, bool checked) { + [] (TextEditorWidget *widget, bool checked) { if (widget) { DisplaySettings ds = widget->displaySettings(); ds.m_visualizeWhitespace = checked; @@ -339,11 +339,11 @@ void TextEditorActionHandlerPrivate::createActions() G_EDIT_FORMAT, advancedEditMenu); m_visualizeWhitespaceAction->setCheckable(true); m_cleanWhitespaceAction = registerAction(CLEAN_WHITESPACE, - [this] (TextEditorWidget *w) { w->cleanWhitespace(); }, true, tr("Clean Whitespace"), + [] (TextEditorWidget *w) { w->cleanWhitespace(); }, true, tr("Clean Whitespace"), QKeySequence(), G_EDIT_FORMAT, advancedEditMenu); m_textWrappingAction = registerBoolAction(TEXT_WRAPPING, - [this] (TextEditorWidget *widget, bool checked) { + [] (TextEditorWidget *widget, bool checked) { if (widget) { DisplaySettings ds = widget->displaySettings(); ds.m_textWrapping = checked; @@ -355,120 +355,120 @@ void TextEditorActionHandlerPrivate::createActions() G_EDIT_FORMAT, advancedEditMenu); m_textWrappingAction->setCheckable(true); m_unCommentSelectionAction = registerAction(UN_COMMENT_SELECTION, - [this] (TextEditorWidget *w) { w->unCommentSelection(); }, true, tr("Toggle Comment &Selection"), + [] (TextEditorWidget *w) { w->unCommentSelection(); }, true, tr("Toggle Comment &Selection"), QKeySequence(tr("Ctrl+/")), G_EDIT_FORMAT, advancedEditMenu); m_cutLineAction = registerAction(CUT_LINE, - [this] (TextEditorWidget *w) { w->cutLine(); }, true, tr("Cut &Line"), + [] (TextEditorWidget *w) { w->cutLine(); }, true, tr("Cut &Line"), QKeySequence(tr("Shift+Del")), G_EDIT_TEXT, advancedEditMenu); m_copyLineAction = registerAction(COPY_LINE, - [this] (TextEditorWidget *w) { w->copyLine(); }, false, tr("Copy &Line"), + [] (TextEditorWidget *w) { w->copyLine(); }, false, tr("Copy &Line"), QKeySequence(tr("Ctrl+Ins")), G_EDIT_TEXT, advancedEditMenu); m_duplicateSelectionAction = registerAction(DUPLICATE_SELECTION, - [this] (TextEditorWidget *w) { w->duplicateSelection(); }, false, tr("&Duplicate Selection"), + [] (TextEditorWidget *w) { w->duplicateSelection(); }, false, tr("&Duplicate Selection"), QKeySequence(), G_EDIT_TEXT, advancedEditMenu); m_duplicateSelectionAndCommentAction = registerAction(DUPLICATE_SELECTION_AND_COMMENT, - [this] (TextEditorWidget *w) { w->duplicateSelectionAndComment(); }, false, tr("&Duplicate Selection and Comment"), + [] (TextEditorWidget *w) { w->duplicateSelectionAndComment(); }, false, tr("&Duplicate Selection and Comment"), QKeySequence(), G_EDIT_TEXT, advancedEditMenu); m_upperCaseSelectionAction = registerAction(UPPERCASE_SELECTION, - [this] (TextEditorWidget *w) { w->uppercaseSelection(); }, true, tr("Uppercase Selection"), + [] (TextEditorWidget *w) { w->uppercaseSelection(); }, true, tr("Uppercase Selection"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+U") : tr("Alt+Shift+U")), G_EDIT_TEXT, advancedEditMenu); m_lowerCaseSelectionAction = registerAction(LOWERCASE_SELECTION, - [this] (TextEditorWidget *w) { w->lowercaseSelection(); }, true, tr("Lowercase Selection"), + [] (TextEditorWidget *w) { w->lowercaseSelection(); }, true, tr("Lowercase Selection"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+U") : tr("Alt+U")), G_EDIT_TEXT, advancedEditMenu); m_foldAction = registerAction(FOLD, - [this] (TextEditorWidget *w) { w->fold(); }, true, tr("Fold"), + [] (TextEditorWidget *w) { w->fold(); }, true, tr("Fold"), QKeySequence(tr("Ctrl+<")), G_EDIT_COLLAPSING, advancedEditMenu); m_unfoldAction = registerAction(UNFOLD, - [this] (TextEditorWidget *w) { w->unfold(); }, true, tr("Unfold"), + [] (TextEditorWidget *w) { w->unfold(); }, true, tr("Unfold"), QKeySequence(tr("Ctrl+>")), G_EDIT_COLLAPSING, advancedEditMenu); m_unfoldAllAction = registerAction(UNFOLD_ALL, - [this] (TextEditorWidget *w) { w->unfoldAll(); }, true, tr("Toggle &Fold All"), + [] (TextEditorWidget *w) { w->unfoldAll(); }, true, tr("Toggle &Fold All"), QKeySequence(), G_EDIT_COLLAPSING, advancedEditMenu); m_increaseFontSizeAction = registerAction(INCREASE_FONT_SIZE, - [this] (TextEditorWidget *w) { w->zoomF(1.f); }, false, tr("Increase Font Size"), + [] (TextEditorWidget *w) { w->zoomF(1.f); }, false, tr("Increase Font Size"), QKeySequence(tr("Ctrl++")), G_EDIT_FONT, advancedEditMenu); m_decreaseFontSizeAction = registerAction(DECREASE_FONT_SIZE, - [this] (TextEditorWidget *w) { w->zoomF(-1.f); }, false, tr("Decrease Font Size"), + [] (TextEditorWidget *w) { w->zoomF(-1.f); }, false, tr("Decrease Font Size"), QKeySequence(tr("Ctrl+-")), G_EDIT_FONT, advancedEditMenu); m_resetFontSizeAction = registerAction(RESET_FONT_SIZE, - [this] (TextEditorWidget *w) { w->zoomReset(); }, false, tr("Reset Font Size"), + [] (TextEditorWidget *w) { w->zoomReset(); }, false, tr("Reset Font Size"), QKeySequence(Core::UseMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")), G_EDIT_FONT, advancedEditMenu); m_gotoBlockStartAction = registerAction(GOTO_BLOCK_START, - [this] (TextEditorWidget *w) { w->gotoBlockStart(); }, true, tr("Go to Block Start"), + [] (TextEditorWidget *w) { w->gotoBlockStart(); }, true, tr("Go to Block Start"), QKeySequence(tr("Ctrl+[")), G_EDIT_BLOCKS, advancedEditMenu); m_gotoBlockEndAction = registerAction(GOTO_BLOCK_END, - [this] (TextEditorWidget *w) { w->gotoBlockEnd(); }, true, tr("Go to Block End"), + [] (TextEditorWidget *w) { w->gotoBlockEnd(); }, true, tr("Go to Block End"), QKeySequence(tr("Ctrl+]")), G_EDIT_BLOCKS, advancedEditMenu); m_selectBlockUpAction = registerAction(SELECT_BLOCK_UP, - [this] (TextEditorWidget *w) { w->selectBlockUp(); }, true, tr("Select Block Up"), + [] (TextEditorWidget *w) { w->selectBlockUp(); }, true, tr("Select Block Up"), QKeySequence(tr("Ctrl+U")), G_EDIT_BLOCKS, advancedEditMenu); m_selectBlockDownAction = registerAction(SELECT_BLOCK_DOWN, - [this] (TextEditorWidget *w) { w->selectBlockDown(); }, true, tr("Select Block Down"), + [] (TextEditorWidget *w) { w->selectBlockDown(); }, true, tr("Select Block Down"), QKeySequence(tr("Ctrl+Shift+Alt+U")), G_EDIT_BLOCKS, advancedEditMenu); registerAction(SELECT_WORD_UNDER_CURSOR, - [this] (TextEditorWidget *w) { w->selectWordUnderCursor(); }, true, + [] (TextEditorWidget *w) { w->selectWordUnderCursor(); }, true, tr("Select Word Under Cursor")); // register GOTO Actions registerAction(GOTO_LINE_START, - [this] (TextEditorWidget *w) { w->gotoLineStart(); }, true, tr("Go to Line Start")); + [] (TextEditorWidget *w) { w->gotoLineStart(); }, true, tr("Go to Line Start")); registerAction(GOTO_LINE_END, - [this] (TextEditorWidget *w) { w->gotoLineEnd(); }, true, tr("Go to Line End")); + [] (TextEditorWidget *w) { w->gotoLineEnd(); }, true, tr("Go to Line End")); registerAction(GOTO_NEXT_LINE, - [this] (TextEditorWidget *w) { w->gotoNextLine(); }, true, tr("Go to Next Line")); + [] (TextEditorWidget *w) { w->gotoNextLine(); }, true, tr("Go to Next Line")); registerAction(GOTO_PREVIOUS_LINE, - [this] (TextEditorWidget *w) { w->gotoPreviousLine(); }, true, tr("Go to Previous Line")); + [] (TextEditorWidget *w) { w->gotoPreviousLine(); }, true, tr("Go to Previous Line")); registerAction(GOTO_PREVIOUS_CHARACTER, - [this] (TextEditorWidget *w) { w->gotoPreviousCharacter(); }, true, tr("Go to Previous Character")); + [] (TextEditorWidget *w) { w->gotoPreviousCharacter(); }, true, tr("Go to Previous Character")); registerAction(GOTO_NEXT_CHARACTER, - [this] (TextEditorWidget *w) { w->gotoNextCharacter(); }, true, tr("Go to Next Character")); + [] (TextEditorWidget *w) { w->gotoNextCharacter(); }, true, tr("Go to Next Character")); registerAction(GOTO_PREVIOUS_WORD, - [this] (TextEditorWidget *w) { w->gotoPreviousWord(); }, true, tr("Go to Previous Word")); + [] (TextEditorWidget *w) { w->gotoPreviousWord(); }, true, tr("Go to Previous Word")); registerAction(GOTO_NEXT_WORD, - [this] (TextEditorWidget *w) { w->gotoNextWord(); }, true, tr("Go to Next Word")); + [] (TextEditorWidget *w) { w->gotoNextWord(); }, true, tr("Go to Next Word")); registerAction(GOTO_PREVIOUS_WORD_CAMEL_CASE, - [this] (TextEditorWidget *w) { w->gotoPreviousWordCamelCase(); }, false, tr("Go to Previous Word Camel Case")); + [] (TextEditorWidget *w) { w->gotoPreviousWordCamelCase(); }, false, tr("Go to Previous Word Camel Case")); registerAction(GOTO_NEXT_WORD_CAMEL_CASE, - [this] (TextEditorWidget *w) { w->gotoNextWordCamelCase(); }, false, tr("Go to Next Word Camel Case")); + [] (TextEditorWidget *w) { w->gotoNextWordCamelCase(); }, false, tr("Go to Next Word Camel Case")); // register GOTO actions with selection registerAction(GOTO_LINE_START_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoLineStartWithSelection(); }, true, tr("Go to Line Start with Selection")); + [] (TextEditorWidget *w) { w->gotoLineStartWithSelection(); }, true, tr("Go to Line Start with Selection")); registerAction(GOTO_LINE_END_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoLineEndWithSelection(); }, true, tr("Go to Line End with Selection")); + [] (TextEditorWidget *w) { w->gotoLineEndWithSelection(); }, true, tr("Go to Line End with Selection")); registerAction(GOTO_NEXT_LINE_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoNextLineWithSelection(); }, true, tr("Go to Next Line with Selection")); + [] (TextEditorWidget *w) { w->gotoNextLineWithSelection(); }, true, tr("Go to Next Line with Selection")); registerAction(GOTO_PREVIOUS_LINE_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoPreviousLineWithSelection(); }, true, tr("Go to Previous Line with Selection")); + [] (TextEditorWidget *w) { w->gotoPreviousLineWithSelection(); }, true, tr("Go to Previous Line with Selection")); registerAction(GOTO_PREVIOUS_CHARACTER_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoPreviousCharacterWithSelection(); }, true, tr("Go to Previous Character with Selection")); + [] (TextEditorWidget *w) { w->gotoPreviousCharacterWithSelection(); }, true, tr("Go to Previous Character with Selection")); registerAction(GOTO_NEXT_CHARACTER_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoNextCharacterWithSelection(); }, true, tr("Go to Next Character with Selection")); + [] (TextEditorWidget *w) { w->gotoNextCharacterWithSelection(); }, true, tr("Go to Next Character with Selection")); registerAction(GOTO_PREVIOUS_WORD_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoPreviousWordWithSelection(); }, true, tr("Go to Previous Word with Selection")); + [] (TextEditorWidget *w) { w->gotoPreviousWordWithSelection(); }, true, tr("Go to Previous Word with Selection")); registerAction(GOTO_NEXT_WORD_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoNextWordWithSelection(); }, true, tr("Go to Next Word with Selection")); + [] (TextEditorWidget *w) { w->gotoNextWordWithSelection(); }, true, tr("Go to Next Word with Selection")); registerAction(GOTO_PREVIOUS_WORD_CAMEL_CASE_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoPreviousWordCamelCaseWithSelection(); }, false, tr("Go to Previous Word Camel Case with Selection")); + [] (TextEditorWidget *w) { w->gotoPreviousWordCamelCaseWithSelection(); }, false, tr("Go to Previous Word Camel Case with Selection")); registerAction(GOTO_NEXT_WORD_CAMEL_CASE_WITH_SELECTION, - [this] (TextEditorWidget *w) { w->gotoNextWordCamelCaseWithSelection(); }, false, tr("Go to Next Word Camel Case with Selection")); + [] (TextEditorWidget *w) { w->gotoNextWordCamelCaseWithSelection(); }, false, tr("Go to Next Word Camel Case with Selection")); // Collect all modifying actions so we can check for them inside a readonly file // and disable them diff --git a/src/plugins/todo/todoplugin.cpp b/src/plugins/todo/todoplugin.cpp index b99ec94bd1..5b2fef62cd 100644 --- a/src/plugins/todo/todoplugin.cpp +++ b/src/plugins/todo/todoplugin.cpp @@ -71,7 +71,7 @@ bool TodoPlugin::initialize(const QStringList& args, QString *errMsg) auto panelFactory = new ProjectExplorer::ProjectPanelFactory; panelFactory->setPriority(100); panelFactory->setDisplayName(TodoProjectSettingsWidget::tr("To-Do")); - panelFactory->setCreateWidgetFunction([this, panelFactory](ProjectExplorer::Project *project) { + panelFactory->setCreateWidgetFunction([this](ProjectExplorer::Project *project) { auto widget = new TodoProjectSettingsWidget(project); connect(widget, &TodoProjectSettingsWidget::projectSettingsChanged, m_todoItemsProvider, [this, project] { m_todoItemsProvider->projectSettingsChanged(project); }); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index cab6dea44c..a467ad0472 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -434,7 +434,7 @@ MemcheckTool::MemcheckTool() action->setToolTip(toolTip); menu->addAction(ActionManager::registerAction(action, "Memcheck.Remote"), Debugger::Constants::G_ANALYZER_REMOTE_TOOLS); - QObject::connect(action, &QAction::triggered, this, [this, action] { + QObject::connect(action, &QAction::triggered, this, [action] { auto runConfig = RunConfiguration::startupRunConfiguration(); if (!runConfig) { showCannotStartDialog(action->text()); @@ -583,7 +583,7 @@ RunWorker *MemcheckTool::createRunWorker(RunControl *runControl) foreach (const QString &file, runTool->suppressionFiles()) { QAction *action = m_filterMenu->addAction(Utils::FileName::fromString(file).fileName()); action->setToolTip(file); - connect(action, &QAction::triggered, this, [this, file]() { + connect(action, &QAction::triggered, this, [file]() { Core::EditorManager::openEditorAt(file, 0); }); m_suppressionActions.append(action); diff --git a/src/plugins/vcsbase/basevcseditorfactory.cpp b/src/plugins/vcsbase/basevcseditorfactory.cpp index 8b183e5c01..2e26d4026e 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.cpp +++ b/src/plugins/vcsbase/basevcseditorfactory.cpp @@ -63,7 +63,7 @@ VcsEditorFactory::VcsEditorFactory(const VcsBaseEditorParameters *parameters, setEditorActionHandlers(TextEditorActionHandler::None); setDuplicatedSupported(false); - setDocumentCreator([this, parameters]() -> TextDocument* { + setDocumentCreator([parameters]() -> TextDocument* { auto document = new TextDocument(parameters->id); // if (QLatin1String(parameters->mimeType) != QLatin1String(DiffEditor::Constants::DIFF_EDITOR_MIMETYPE)) document->setMimeType(QLatin1String(parameters->mimeType)); @@ -71,7 +71,7 @@ VcsEditorFactory::VcsEditorFactory(const VcsBaseEditorParameters *parameters, return document; }); - setEditorWidgetCreator([this, parameters, editorWidgetCreator, describeFunc]() -> TextEditorWidget * { + setEditorWidgetCreator([parameters, editorWidgetCreator, describeFunc]() -> TextEditorWidget * { auto widget = qobject_cast<VcsBaseEditorWidget *>(editorWidgetCreator()); widget->setDescribeFunc(describeFunc); widget->setParameters(parameters); diff --git a/src/plugins/vcsbase/vcsprojectcache.cpp b/src/plugins/vcsbase/vcsprojectcache.cpp index 6540daf2a7..a2ca3987a6 100644 --- a/src/plugins/vcsbase/vcsprojectcache.cpp +++ b/src/plugins/vcsbase/vcsprojectcache.cpp @@ -74,9 +74,9 @@ VcsProjectCache::VcsProjectCache() m_instance = this; connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::projectAdded, - this, [this]() { VcsProjectCache::invalidate(); }); + this, []() { VcsProjectCache::invalidate(); }); connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::projectRemoved, - this, [this]() { VcsProjectCache::invalidate(); }); + this, []() { VcsProjectCache::invalidate(); }); } VcsProjectCache::~VcsProjectCache() diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 123cbf0437..848e0e6449 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -401,7 +401,7 @@ void WelcomeMode::addPage(IWelcomePage *page) stackPage->setAutoFillBackground(true); m_pageStack->insertWidget(idx, stackPage); - auto onClicked = [this, page, pageId, stackPage] { + auto onClicked = [this, pageId, stackPage] { m_activePage = pageId; m_pageStack->setCurrentWidget(stackPage); for (WelcomePageButton *pageButton : m_pageButtons) |