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 --- tests/test_messagedetailsdialog.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'tests/test_messagedetailsdialog.cpp') diff --git a/tests/test_messagedetailsdialog.cpp b/tests/test_messagedetailsdialog.cpp index 4e685ce..403750b 100644 --- a/tests/test_messagedetailsdialog.cpp +++ b/tests/test_messagedetailsdialog.cpp @@ -131,13 +131,15 @@ void TestMessageDetailsDialog::offersASearchForEachValue() QVERIFY2(date != rows.cend(), "no Date row"); QCOMPARE(date->query, QStringLiteral("date:2026-08-14..2026-08-14")); - // Replacing and narrowing are both offered, and the flag distinguishes them. - dialog.requestSearch(*from, false); - dialog.requestSearch(*from, true); + // Replacing and narrowing are both offered, and the mode distinguishes them. + dialog.requestSearch(*from, SearchTerm::SearchMode::Replace); + dialog.requestSearch(*from, SearchTerm::SearchMode::Narrow); QCOMPARE(spy.count(), 2); QCOMPARE(spy.at(0).at(0).toString(), from->query); - QCOMPARE(spy.at(0).at(1).toBool(), false); - QCOMPARE(spy.at(1).at(1).toBool(), true); + QCOMPARE(spy.at(0).at(1).value(), + SearchTerm::SearchMode::Replace); + QCOMPARE(spy.at(1).at(1).value(), + SearchTerm::SearchMode::Narrow); } void TestMessageDetailsDialog::omitsAnEmptyHeader() @@ -174,7 +176,7 @@ void TestMessageDetailsDialog::messageIdIsShownButNotSearchable() // And asking to search it emits nothing rather than an empty query. QSignalSpy spy(&dialog, &MessageDetailsDialog::searchRequested); - dialog.requestSearch(*id, false); + dialog.requestSearch(*id, SearchTerm::SearchMode::Replace); QCOMPARE(spy.count(), 0); } -- cgit v1.2.3