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>
This commit is contained in:
Ulf Hermann
2017-09-07 17:05:47 +02:00
parent e3ae628584
commit 47886969cc
55 changed files with 216 additions and 218 deletions

View File

@@ -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();
});