forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user