forked from qt-creator/qt-creator
Debugger: Pass context object to lambda connections
Remove some unneeded lambda () brackets. Glue lambda brackets with parameters brackets. Change-Id: I5df67cf01e497ad39c070a3f138a647762f2c33c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -948,9 +948,7 @@ void CdbEngine::runCommand(const DebuggerCommand &dbgCmd)
|
||||
|
||||
QString cmd = dbgCmd.function + dbgCmd.argsToString();
|
||||
if (!m_accessible) {
|
||||
doInterruptInferior([this, dbgCmd](){
|
||||
runCommand(dbgCmd);
|
||||
});
|
||||
doInterruptInferior([this, dbgCmd] { runCommand(dbgCmd); });
|
||||
const QString msg = QString("Attempt to issue command \"%1\" to non-accessible session (%2)... interrupting")
|
||||
.arg(cmd, stateName(state()));
|
||||
showMessage(msg, LogMisc);
|
||||
@@ -1412,7 +1410,7 @@ void CdbEngine::fetchMemory(MemoryAgent *agent, quint64 address, quint64 length)
|
||||
StringInputStream str(args);
|
||||
str << address << ' ' << length;
|
||||
cmd.args = args;
|
||||
cmd.callback = [=] (const DebuggerResponse &response) {
|
||||
cmd.callback = [=](const DebuggerResponse &response) {
|
||||
if (!agent)
|
||||
return;
|
||||
if (response.resultClass == ResultDone) {
|
||||
|
@@ -604,14 +604,10 @@ StartRemoteCdbDialog::StartRemoteCdbDialog(QWidget *parent) :
|
||||
m_okButton = box->button(QDialogButtonBox::Ok);
|
||||
m_okButton->setEnabled(false);
|
||||
|
||||
connect(m_lineEdit, &QLineEdit::textChanged,
|
||||
this, &StartRemoteCdbDialog::textChanged);
|
||||
connect(m_lineEdit, &QLineEdit::returnPressed,
|
||||
[this] { m_okButton->animateClick(); });
|
||||
connect(box, &QDialogButtonBox::accepted,
|
||||
this, &StartRemoteCdbDialog::accept);
|
||||
connect(box, &QDialogButtonBox::rejected,
|
||||
this, &QDialog::reject);
|
||||
connect(m_lineEdit, &QLineEdit::textChanged, this, &StartRemoteCdbDialog::textChanged);
|
||||
connect(m_lineEdit, &QLineEdit::returnPressed, m_okButton, &QAbstractButton::animateClick);
|
||||
connect(box, &QDialogButtonBox::accepted, this, &StartRemoteCdbDialog::accept);
|
||||
connect(box, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
}
|
||||
|
||||
void StartRemoteCdbDialog::accept()
|
||||
|
@@ -796,9 +796,9 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
|
||||
vbox->insertWidget(0, label);
|
||||
};
|
||||
|
||||
const auto addFontSizeAdaptation = [](QWidget *widget) {
|
||||
const auto addFontSizeAdaptation = [this](QWidget *widget) {
|
||||
QObject::connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged,
|
||||
[widget](const FontSettings &settings) {
|
||||
this, [widget](const FontSettings &settings) {
|
||||
if (!debuggerSettings()->fontSizeFollowsEditor.value())
|
||||
return;
|
||||
qreal size = settings.fontZoom() * settings.fontSize() / 100.;
|
||||
@@ -1148,7 +1148,8 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
|
||||
DebuggerMainWindow::leaveDebugMode();
|
||||
});
|
||||
|
||||
connect(ModeManager::instance(), &ModeManager::currentModeChanged, [](Id mode, Id oldMode) {
|
||||
connect(ModeManager::instance(), &ModeManager::currentModeChanged,
|
||||
this, [](Id mode, Id oldMode) {
|
||||
QTC_ASSERT(mode != oldMode, return);
|
||||
if (mode == MODE_DEBUG) {
|
||||
DebuggerMainWindow::enterDebugMode();
|
||||
@@ -1876,7 +1877,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
|
||||
: Tr::tr("Set Breakpoint at Line %1").arg(lineNumber);
|
||||
auto act = menu->addAction(text);
|
||||
act->setEnabled(args.isValid());
|
||||
connect(act, &QAction::triggered, [this, args] {
|
||||
connect(act, &QAction::triggered, this, [this, args] {
|
||||
breakpointSetMarginActionTriggered(false, args);
|
||||
});
|
||||
|
||||
@@ -1886,7 +1887,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
|
||||
: Tr::tr("Set Message Tracepoint at Line %1...").arg(lineNumber);
|
||||
act = menu->addAction(tracePointText);
|
||||
act->setEnabled(args.isValid());
|
||||
connect(act, &QAction::triggered, [this, args] {
|
||||
connect(act, &QAction::triggered, this, [this, args] {
|
||||
breakpointSetMarginActionTriggered(true, args);
|
||||
});
|
||||
}
|
||||
|
@@ -771,7 +771,7 @@ DebuggerToolTipHolder::DebuggerToolTipHolder(const DebuggerToolTipContext &conte
|
||||
|
||||
state = New;
|
||||
|
||||
QObject::connect(widget->pinButton, &QAbstractButton::clicked, [this] {
|
||||
QObject::connect(widget->pinButton, &QAbstractButton::clicked, widget, [this] {
|
||||
if (widget->isPinned)
|
||||
widget->close();
|
||||
else
|
||||
@@ -1194,7 +1194,7 @@ void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested
|
||||
context.expression = localVariable->name;
|
||||
context.iname = localVariable->iname;
|
||||
|
||||
auto reusable = [context] (DebuggerToolTipHolder *tooltip) {
|
||||
auto reusable = [context](DebuggerToolTipHolder *tooltip) {
|
||||
return tooltip->context.isSame(context);
|
||||
};
|
||||
DebuggerToolTipHolder *tooltip = Utils::findOrDefault(m_tooltips, reusable);
|
||||
@@ -1215,7 +1215,7 @@ void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested
|
||||
} else {
|
||||
|
||||
context.iname = "tooltip." + toHex(context.expression);
|
||||
auto reusable = [context] (DebuggerToolTipHolder *tooltip) {
|
||||
auto reusable = [context](DebuggerToolTipHolder *tooltip) {
|
||||
return tooltip->context.isSame(context);
|
||||
};
|
||||
DebuggerToolTipHolder *tooltip = Utils::findOrDefault(m_tooltips, reusable);
|
||||
|
@@ -445,7 +445,7 @@ void EngineManager::deactivateDebugMode()
|
||||
// "previously active application"), doing the switch synchronously
|
||||
// leads to funny effects with floating dock widgets
|
||||
const Utils::Id mode = d->m_previousMode;
|
||||
QTimer::singleShot(0, d, [mode]() { ModeManager::activateMode(mode); });
|
||||
QTimer::singleShot(0, d, [mode] { ModeManager::activateMode(mode); });
|
||||
d->m_previousMode = Id();
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ LocalsAndInspectorWindow::LocalsAndInspectorWindow(QWidget *locals,
|
||||
// when debugger engine changes states.
|
||||
m_timer.setSingleShot(true);
|
||||
m_timer.setInterval(500); // TODO: remove the magic number!
|
||||
connect(&m_timer, &QTimer::timeout, [this, localsAndInspector] {
|
||||
connect(&m_timer, &QTimer::timeout, this, [this, localsAndInspector] {
|
||||
localsAndInspector->setCurrentIndex(m_showLocals ? LocalsIndex : InspectorIndex);
|
||||
});
|
||||
}
|
||||
|
@@ -719,7 +719,7 @@ void UvscEngine::handleUpdateLocals(bool partial)
|
||||
watchHandler()->appendFormatRequests(&cmd);
|
||||
watchHandler()->appendWatchersAndTooltipRequests(&cmd);
|
||||
|
||||
auto enumerateExpandedINames = [&cmd]() {
|
||||
auto enumerateExpandedINames = [&cmd] {
|
||||
QStringList inames;
|
||||
const QJsonArray array = cmd.args["expanded"].toArray();
|
||||
for (const QJsonValue &value : array)
|
||||
@@ -727,7 +727,7 @@ void UvscEngine::handleUpdateLocals(bool partial)
|
||||
return inames;
|
||||
};
|
||||
|
||||
auto enumerateRootWatchers = [&cmd]() {
|
||||
auto enumerateRootWatchers = [&cmd] {
|
||||
std::vector<std::pair<QString, QString>> inames;
|
||||
const QJsonArray array = cmd.args["watchers"].toArray();
|
||||
for (const QJsonValue &value : array) {
|
||||
|
Reference in New Issue
Block a user