From 78b3a9c1769d37ff7344360b6fed66b12b2f0649 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 14 Aug 2026 18:01:28 +0200 Subject: refactor(search): carry SearchMode instead of bool extend Four signatures, no behaviour change: the two shipped operations map to Replace and Narrow. runSearchFromPane becomes a switch and gains the Exclude arm, which nothing can reach until the menu entry exists. Seven call sites across three test files moved with it, two more than the plan predicted: test_messageview and test_mainwindow also drive these signals directly. mainwindow.h and messagedetailsdialog.h now include searchterm.h for the type; messageview.h already did. Co-Authored-By: Claude Opus 5 --- src/messagedetailsdialog.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/messagedetailsdialog.cpp') diff --git a/src/messagedetailsdialog.cpp b/src/messagedetailsdialog.cpp index 058814b..e487270 100644 --- a/src/messagedetailsdialog.cpp +++ b/src/messagedetailsdialog.cpp @@ -88,10 +88,16 @@ MessageDetailsDialog::MessageDetailsDialog(const QList &items, QMenu menu(this); auto *replace = menu.addAction(tr("Search for this")); connect(replace, &QAction::triggered, this, - [this, row]() { requestSearch(row, false); }); + [this, row]() { + requestSearch( + row, SearchTerm::SearchMode::Replace); + }); auto *narrow = menu.addAction(tr("Add to search")); connect(narrow, &QAction::triggered, this, - [this, row]() { requestSearch(row, true); }); + [this, row]() { + requestSearch( + row, SearchTerm::SearchMode::Narrow); + }); menu.exec(value->mapToGlobal(pos)); }); } @@ -145,9 +151,10 @@ void MessageDetailsDialog::buildRows(const QList &items) } } -void MessageDetailsDialog::requestSearch(const HeaderRow &row, bool extend) +void MessageDetailsDialog::requestSearch(const HeaderRow &row, + SearchTerm::SearchMode mode) { if (row.query.isEmpty()) return; - emit searchRequested(row.query, extend); + emit searchRequested(row.query, mode); } -- cgit v1.2.3