aboutsummaryrefslogtreecommitdiffstats
path: root/src/messageview.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-14 18:01:28 +0200
committerDanilo M. <danix@danix.xyz>2026-08-14 18:01:28 +0200
commit78b3a9c1769d37ff7344360b6fed66b12b2f0649 (patch)
treeacc2f6f4c995f2c378e82a83f5800a9f3d6e6b48 /src/messageview.cpp
parentf7fa8bb6aefa5896fc7fdfb694f2a2752eb88ed5 (diff)
downloadqtmaildir-78b3a9c1769d37ff7344360b6fed66b12b2f0649.tar.gz
qtmaildir-78b3a9c1769d37ff7344360b6fed66b12b2f0649.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'src/messageview.cpp')
-rw-r--r--src/messageview.cpp14
1 files changed, 8 insertions, 6 deletions
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<SearchOffer> &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();