diff options
| author | Alexander Taylor <alex@vector35.com> | 2025-05-28 00:10:51 -0400 |
|---|---|---|
| committer | Alexander Taylor <alex@vector35.com> | 2025-06-25 18:36:48 -0400 |
| commit | 8a4dafc1b6ea114a30844dd153de2714d2d286f9 (patch) | |
| tree | c6a6fa1c60e420c1ceb8577d4e2f79bb9133b55a /examples/triage | |
| parent | 0838242066437a04e3aa3417cab703cc071adde6 (diff) | |
Fix cxx20 compiler warnings.
Diffstat (limited to 'examples/triage')
| -rw-r--r-- | examples/triage/byte.cpp | 48 | ||||
| -rw-r--r-- | examples/triage/entropy.cpp | 2 | ||||
| -rw-r--r-- | examples/triage/entry.cpp | 2 | ||||
| -rw-r--r-- | examples/triage/exports.cpp | 8 | ||||
| -rw-r--r-- | examples/triage/files.cpp | 2 | ||||
| -rw-r--r-- | examples/triage/imports.cpp | 2 | ||||
| -rw-r--r-- | examples/triage/strings.cpp | 2 |
7 files changed, 33 insertions, 33 deletions
diff --git a/examples/triage/byte.cpp b/examples/triage/byte.cpp index 3acab281..12ffcb43 100644 --- a/examples/triage/byte.cpp +++ b/examples/triage/byte.cpp @@ -67,30 +67,30 @@ ByteView::ByteView(QWidget* parent, BinaryViewRef data) : QAbstractScrollArea(pa m_updateTimer->setSingleShot(false); // connect(m_updateTimer, &QTimer::timeout, this, &ByteView::updateTimerEvent); - actionHandler()->bindAction("Move Cursor Up", UIAction([=]() { up(false); })); - actionHandler()->bindAction("Move Cursor Down", UIAction([=]() { down(false); })); - actionHandler()->bindAction("Move Cursor Left", UIAction([=]() { left(1, false); })); - actionHandler()->bindAction("Move Cursor Right", UIAction([=]() { right(1, false); })); - actionHandler()->bindAction("Move Cursor Word Left", UIAction([=]() { left(8, false); })); - actionHandler()->bindAction("Move Cursor Word Right", UIAction([=]() { right(8, false); })); - actionHandler()->bindAction("Extend Selection Up", UIAction([=]() { up(true); })); - actionHandler()->bindAction("Extend Selection Down", UIAction([=]() { down(true); })); - actionHandler()->bindAction("Extend Selection Left", UIAction([=]() { left(1, true); })); - actionHandler()->bindAction("Extend Selection Right", UIAction([=]() { right(1, true); })); - actionHandler()->bindAction("Extend Selection Word Left", UIAction([=]() { left(8, true); })); - actionHandler()->bindAction("Extend Selection Word Right", UIAction([=]() { right(8, true); })); - actionHandler()->bindAction("Page Up", UIAction([=]() { pageUp(false); })); - actionHandler()->bindAction("Page Down", UIAction([=]() { pageDown(false); })); - actionHandler()->bindAction("Extend Selection Page Up", UIAction([=]() { pageUp(true); })); - actionHandler()->bindAction("Extend Selection Page Down", UIAction([=]() { pageDown(true); })); - actionHandler()->bindAction("Move Cursor to Start of Line", UIAction([=]() { moveToStartOfLine(false); })); - actionHandler()->bindAction("Move Cursor to End of Line", UIAction([=]() { moveToEndOfLine(false); })); - actionHandler()->bindAction("Move Cursor to Start of View", UIAction([=]() { moveToStartOfView(false); })); - actionHandler()->bindAction("Move Cursor to End of View", UIAction([=]() { moveToEndOfView(false); })); - actionHandler()->bindAction("Extend Selection to Start of Line", UIAction([=]() { moveToStartOfLine(true); })); - actionHandler()->bindAction("Extend Selection to End of Line", UIAction([=]() { moveToEndOfLine(true); })); - actionHandler()->bindAction("Extend Selection to Start of View", UIAction([=]() { moveToStartOfView(true); })); - actionHandler()->bindAction("Extend Selection to End of View", UIAction([=]() { moveToEndOfView(true); })); + actionHandler()->bindAction("Move Cursor Up", UIAction([=, this]() { up(false); })); + actionHandler()->bindAction("Move Cursor Down", UIAction([=, this]() { down(false); })); + actionHandler()->bindAction("Move Cursor Left", UIAction([=, this]() { left(1, false); })); + actionHandler()->bindAction("Move Cursor Right", UIAction([=, this]() { right(1, false); })); + actionHandler()->bindAction("Move Cursor Word Left", UIAction([=, this]() { left(8, false); })); + actionHandler()->bindAction("Move Cursor Word Right", UIAction([=, this]() { right(8, false); })); + actionHandler()->bindAction("Extend Selection Up", UIAction([=, this]() { up(true); })); + actionHandler()->bindAction("Extend Selection Down", UIAction([=, this]() { down(true); })); + actionHandler()->bindAction("Extend Selection Left", UIAction([=, this]() { left(1, true); })); + actionHandler()->bindAction("Extend Selection Right", UIAction([=, this]() { right(1, true); })); + actionHandler()->bindAction("Extend Selection Word Left", UIAction([=, this]() { left(8, true); })); + actionHandler()->bindAction("Extend Selection Word Right", UIAction([=, this]() { right(8, true); })); + actionHandler()->bindAction("Page Up", UIAction([=, this]() { pageUp(false); })); + actionHandler()->bindAction("Page Down", UIAction([=, this]() { pageDown(false); })); + actionHandler()->bindAction("Extend Selection Page Up", UIAction([=, this]() { pageUp(true); })); + actionHandler()->bindAction("Extend Selection Page Down", UIAction([=, this]() { pageDown(true); })); + actionHandler()->bindAction("Move Cursor to Start of Line", UIAction([=, this]() { moveToStartOfLine(false); })); + actionHandler()->bindAction("Move Cursor to End of Line", UIAction([=, this]() { moveToEndOfLine(false); })); + actionHandler()->bindAction("Move Cursor to Start of View", UIAction([=, this]() { moveToStartOfView(false); })); + actionHandler()->bindAction("Move Cursor to End of View", UIAction([=, this]() { moveToEndOfView(false); })); + actionHandler()->bindAction("Extend Selection to Start of Line", UIAction([=, this]() { moveToStartOfLine(true); })); + actionHandler()->bindAction("Extend Selection to End of Line", UIAction([=, this]() { moveToEndOfLine(true); })); + actionHandler()->bindAction("Extend Selection to Start of View", UIAction([=, this]() { moveToStartOfView(true); })); + actionHandler()->bindAction("Extend Selection to End of View", UIAction([=, this]() { moveToEndOfView(true); })); } diff --git a/examples/triage/entropy.cpp b/examples/triage/entropy.cpp index b43350cd..229c7079 100644 --- a/examples/triage/entropy.cpp +++ b/examples/triage/entropy.cpp @@ -12,7 +12,7 @@ EntropyThread::EntropyThread(BinaryViewRef data, size_t blockSize, QImage* image m_blockSize = blockSize; m_updated = false; m_running = true; - m_thread = std::thread([=]() { Run(); }); + m_thread = std::thread([=, this]() { Run(); }); } diff --git a/examples/triage/entry.cpp b/examples/triage/entry.cpp index 4c7f5ec0..f66634f1 100644 --- a/examples/triage/entry.cpp +++ b/examples/triage/entry.cpp @@ -160,7 +160,7 @@ EntryTreeView::EntryTreeView(EntryWidget* parent, TriageView* view, BinaryViewRe // Allow view-specific shortcuts when imports are focused m_actionHandler.setupActionHandler(this); - m_actionHandler.setActionContext([=]() { return m_view->actionContext(); }); + m_actionHandler.setActionContext([=, this]() { return m_view->actionContext(); }); m_model = new GenericEntryModel(this, m_data); setModel(m_model); diff --git a/examples/triage/exports.cpp b/examples/triage/exports.cpp index 067ebe92..4d274b1a 100644 --- a/examples/triage/exports.cpp +++ b/examples/triage/exports.cpp @@ -28,7 +28,7 @@ GenericExportsModel::GenericExportsModel(QWidget* parent, BinaryViewRef data): Q m_updateTimer->setSingleShot(true); m_updateTimer->setInterval(500); connect(m_updateTimer, &QTimer::timeout, this, &GenericExportsModel::updateModel); - connect(this, &GenericExportsModel::modelUpdate, this, [=]() { + connect(this, &GenericExportsModel::modelUpdate, this, [=, this]() { if (m_updateTimer->isActive()) return; m_updateTimer->start(); @@ -285,7 +285,7 @@ ExportsTreeView::ExportsTreeView(ExportsWidget* parent, TriageView* view, Binary // Allow view-specific shortcuts when imports are focused m_actionHandler.setupActionHandler(this); - m_actionHandler.setActionContext([=]() { return m_view->actionContext(); }); + m_actionHandler.setActionContext([=, this]() { return m_view->actionContext(); }); setFont(getMonospaceFont(this)); @@ -306,11 +306,11 @@ ExportsTreeView::ExportsTreeView(ExportsWidget* parent, TriageView* view, Binary connect(selectionModel(), &QItemSelectionModel::currentChanged, this, &ExportsTreeView::exportSelected); connect(this, &QTreeView::doubleClicked, this, &ExportsTreeView::exportDoubleClicked); - connect(m_model, &QAbstractItemModel::modelAboutToBeReset, this, [=]() { + connect(m_model, &QAbstractItemModel::modelAboutToBeReset, this, [=, this]() { m_selection = selectionModel()->selectedIndexes(); m_scroll = verticalScrollBar()->value(); }); - connect(m_model, &QAbstractItemModel::modelReset, this, [=]() { + connect(m_model, &QAbstractItemModel::modelReset, this, [=, this]() { for (auto& idx : m_selection) { setCurrentIndex(idx); diff --git a/examples/triage/files.cpp b/examples/triage/files.cpp index d70b61cd..f1d7e09e 100644 --- a/examples/triage/files.cpp +++ b/examples/triage/files.cpp @@ -46,7 +46,7 @@ TriageFilePicker::TriageFilePicker(UIContext* context) } m_actionHandler.bindAction( - "Open Selected Files", UIAction([=]() { openSelectedFiles(); }, [=]() { return areFilesSelected(); })); + "Open Selected Files", UIAction([=, this]() { openSelectedFiles(); }, [=, this]() { return areFilesSelected(); })); m_contextMenu.addAction("Open Selected Files", "Open"); } diff --git a/examples/triage/imports.cpp b/examples/triage/imports.cpp index 1cc066de..62c8a370 100644 --- a/examples/triage/imports.cpp +++ b/examples/triage/imports.cpp @@ -232,7 +232,7 @@ ImportsTreeView::ImportsTreeView(ImportsWidget* parent, TriageView* view, Binary // Allow view-specific shortcuts when imports are focused m_actionHandler.setupActionHandler(this); - m_actionHandler.setActionContext([=]() { return m_view->actionContext(); }); + m_actionHandler.setActionContext([=, this]() { return m_view->actionContext(); }); m_model = new GenericImportsModel(this, m_data); setModel(m_model); diff --git a/examples/triage/strings.cpp b/examples/triage/strings.cpp index 7c3f44e8..f7fe5989 100644 --- a/examples/triage/strings.cpp +++ b/examples/triage/strings.cpp @@ -186,7 +186,7 @@ StringsTreeView::StringsTreeView(StringsWidget* parent, TriageView* view, Binary // Allow view-specific shortcuts when strings are focused m_actionHandler.setupActionHandler(this); - m_actionHandler.setActionContext([=]() { return m_view->actionContext(); }); + m_actionHandler.setActionContext([=, this]() { return m_view->actionContext(); }); m_model = new GenericStringsModel(this, m_data); setModel(m_model); |
