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.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/messagedetailsdialog.h') diff --git a/src/messagedetailsdialog.h b/src/messagedetailsdialog.h index f865913..b141c39 100644 --- a/src/messagedetailsdialog.h +++ b/src/messagedetailsdialog.h @@ -23,6 +23,7 @@ #include #include "htmlbuilder.h" +#include "searchterm.h" /// One header of one message, as shown and as searched for. /// @@ -72,12 +73,13 @@ public: /// Emits searchRequested for `row`, or nothing when the row carries no /// searchable query. The menu entries call this; a test can too, without /// popping a menu. - void requestSearch(const HeaderRow &row, bool extend); + void requestSearch(const HeaderRow &row, SearchTerm::SearchMode mode); signals: - /// The user chose a search from a row's menu. `extend` narrows the current - /// query rather than replacing it. - void searchRequested(const QString &query, bool extend); + /// The user chose a search from a row's menu. `mode` says whether to + /// replace the query, narrow it, or narrow it by everything that is not + /// this value. + void searchRequested(const QString &query, SearchTerm::SearchMode mode); private: /// Builds the rows from the thread, one group per message. -- cgit v1.2.3