From f7fa8bb6aefa5896fc7fdfb694f2a2752eb88ed5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 14 Aug 2026 17:59:08 +0200 Subject: refactor(search): add SearchMode, the type replacing bool extend Introduced alone, ahead of the four signatures that change to it, so that change lands as one mechanical commit with no behaviour difference. Co-Authored-By: Claude Opus 5 --- src/searchterm.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/searchterm.h') diff --git a/src/searchterm.h b/src/searchterm.h index 646fd77..3a0cac2 100644 --- a/src/searchterm.h +++ b/src/searchterm.h @@ -40,6 +40,22 @@ namespace SearchTerm { /// able to read. inline constexpr int kMaxValueLength = 200; +/// Which of the three search operations a menu entry asked for. +/// +/// Replaces the `bool extend` that carried two operations and had no room for +/// a third. A plain enum class, deliberately NOT registered as a metatype: +/// every connection carrying it is direct, within the UI thread. The `Q_ENUM` +/// trap recorded in CLAUDE.md belongs to the queued signals into +/// NotmuchWorker and does not apply here. +enum class SearchMode { + /// Replace the query bar outright. + Replace, + /// Narrow what is already there, via extend(). + Narrow, + /// Narrow by everything that is not this value, via exclude(). + Exclude, +}; + /// Quotes an arbitrary value for use as a notmuch term. /// /// Whitespace and newlines collapse to single spaces, embedded quotes are -- cgit v1.2.3