diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-14 18:01:28 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-14 18:01:28 +0200 |
| commit | 78b3a9c1769d37ff7344360b6fed66b12b2f0649 (patch) | |
| tree | acc2f6f4c995f2c378e82a83f5800a9f3d6e6b48 /src/messagedetailsdialog.cpp | |
| parent | f7fa8bb6aefa5896fc7fdfb694f2a2752eb88ed5 (diff) | |
| download | qtmaildir-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/messagedetailsdialog.cpp')
| -rw-r--r-- | src/messagedetailsdialog.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/messagedetailsdialog.cpp b/src/messagedetailsdialog.cpp index 058814b..e487270 100644 --- a/src/messagedetailsdialog.cpp +++ b/src/messagedetailsdialog.cpp @@ -88,10 +88,16 @@ MessageDetailsDialog::MessageDetailsDialog(const QList<ThreadRenderItem> &items, QMenu menu(this); auto *replace = menu.addAction(tr("Search for this")); connect(replace, &QAction::triggered, this, - [this, row]() { requestSearch(row, false); }); + [this, row]() { + requestSearch( + row, SearchTerm::SearchMode::Replace); + }); auto *narrow = menu.addAction(tr("Add to search")); connect(narrow, &QAction::triggered, this, - [this, row]() { requestSearch(row, true); }); + [this, row]() { + requestSearch( + row, SearchTerm::SearchMode::Narrow); + }); menu.exec(value->mapToGlobal(pos)); }); } @@ -145,9 +151,10 @@ void MessageDetailsDialog::buildRows(const QList<ThreadRenderItem> &items) } } -void MessageDetailsDialog::requestSearch(const HeaderRow &row, bool extend) +void MessageDetailsDialog::requestSearch(const HeaderRow &row, + SearchTerm::SearchMode mode) { if (row.query.isEmpty()) return; - emit searchRequested(row.query, extend); + emit searchRequested(row.query, mode); } |
