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_mainwindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/test_mainwindow.cpp') diff --git a/tests/test_mainwindow.cpp b/tests/test_mainwindow.cpp index 8b60e37..0bf8925 100644 --- a/tests/test_mainwindow.cpp +++ b/tests/test_mainwindow.cpp @@ -3741,7 +3741,8 @@ void TestMainWindow::aSearchFromThePaneReplacesTheQuery() QVERIFY2(view, "no message view"); queryEdit->setText(QStringLiteral("tag:inbox")); - emit view->searchRequested(QStringLiteral("from:\"foo@example.org\""), false); + emit view->searchRequested(QStringLiteral("from:\"foo@example.org\""), + SearchTerm::SearchMode::Replace); QCOMPARE(queryEdit->text(), QStringLiteral("from:\"foo@example.org\"")); } @@ -3763,7 +3764,8 @@ void TestMainWindow::aSearchFromThePaneCanNarrowTheQuery() QVERIFY2(view, "no message view"); queryEdit->setText(QStringLiteral("tag:inbox or tag:flagged")); - emit view->searchRequested(QStringLiteral("from:\"foo@example.org\""), true); + emit view->searchRequested(QStringLiteral("from:\"foo@example.org\""), + SearchTerm::SearchMode::Narrow); QCOMPARE(queryEdit->text(), QStringLiteral("(tag:inbox or tag:flagged) AND (from:\"foo@example.org\")")); @@ -3783,7 +3785,8 @@ void TestMainWindow::narrowingAnEmptyQueryBarIsAPlainSearch() QVERIFY2(view, "no message view"); queryEdit->clear(); - emit view->searchRequested(QStringLiteral("tag:inbox"), true); + emit view->searchRequested(QStringLiteral("tag:inbox"), + SearchTerm::SearchMode::Narrow); QCOMPARE(queryEdit->text(), QStringLiteral("tag:inbox")); } -- cgit v1.2.3