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/messageview.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/messageview.cpp') diff --git a/src/messageview.cpp b/src/messageview.cpp index 2e7e694..26ef7e3 100644 --- a/src/messageview.cpp +++ b/src/messageview.cpp @@ -569,12 +569,14 @@ void MessageView::addSearchEntries(QMenu *menu, const QList &offers auto *sub = menu->addMenu(tr("Search for %1").arg(entry.label)); auto *replace = sub->addAction(tr("Search for this")); - connect(replace, &QAction::triggered, this, - [this, entry]() { emit searchRequested(entry.query, false); }); + connect(replace, &QAction::triggered, this, [this, entry]() { + emit searchRequested(entry.query, SearchTerm::SearchMode::Replace); + }); auto *narrow = sub->addAction(tr("Add to search")); - connect(narrow, &QAction::triggered, this, - [this, entry]() { emit searchRequested(entry.query, true); }); + connect(narrow, &QAction::triggered, this, [this, entry]() { + emit searchRequested(entry.query, SearchTerm::SearchMode::Narrow); + }); } } @@ -645,9 +647,9 @@ void MessageView::showDetailsDialog() // from. Closing first leaves no window in which the dialog describes a // thread the pane has already dropped. connect(&dialog, &MessageDetailsDialog::searchRequested, this, - [this, &dialog](const QString &query, bool extend) { + [this, &dialog](const QString &query, SearchTerm::SearchMode mode) { dialog.accept(); - emit searchRequested(query, extend); + emit searchRequested(query, mode); }); dialog.exec(); -- cgit v1.2.3