aboutsummaryrefslogtreecommitdiffstats
path: root/src/searchterm.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-31 11:41:08 +0100
committerDanilo M. <danix@danix.xyz>2026-11-17 10:26:18 +0100
commit4161ac9a31e160c0dbdd8b1998a1895fe95dcf93 (patch)
treeb3cfc27e16cae1a7d649bc6648108f56db09996c /src/searchterm.h
parentc608ce2bfb5e4a6aba319e23d4a8bd299ebb4a3b (diff)
downloadqtmaildir-4161ac9a31e160c0dbdd8b1998a1895fe95dcf93.tar.gz
qtmaildir-4161ac9a31e160c0dbdd8b1998a1895fe95dcf93.zip
feat: build the query for what a tag change would move
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/searchterm.h')
-rw-r--r--src/searchterm.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/searchterm.h b/src/searchterm.h
index 8ca67e4..dd43e99 100644
--- a/src/searchterm.h
+++ b/src/searchterm.h
@@ -111,6 +111,20 @@ QString extend(const QString &existing, const QString &addition);
/// An empty `addition` leaves `existing` untouched.
QString exclude(const QString &existing, const QString &addition);
+/// The messages among `query` that `+add -remove` would actually change:
+/// `(query) AND (not tag:a1 or ... or tag:r1 ...)`.
+///
+/// Used to count and to write a rule applied to existing mail (item 212), so
+/// the number in the confirmation is the number of messages touched, not the
+/// number matched. Built on extend(), so a disjunction in the rule cannot
+/// escape the scope.
+///
+/// **Never empty.** An empty query or an empty change yields
+/// Config::matchNothingQuery(), because notmuch reads an empty query as
+/// "match everything" and this string is written to.
+QString changes(const QString &query, const QStringList &add,
+ const QStringList &remove);
+
} // namespace SearchTerm
/// One entry a context menu can offer: a finished query and the text naming it.