From 612eb64871de7e00f21a9b7ebf33d8179caa16bc Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 14 Aug 2026 18:02:38 +0200 Subject: feat(search): push the query bar's emptiness into the panes The menus cannot read the query bar and must not. MainWindow already watched textChanged for the Save button; the same lambda now also tells MessageView, which passes it to the details dialog at construction, where it cannot go stale. Nothing consumes it yet. Co-Authored-By: Claude Opus 5 --- src/messageview.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/messageview.h') diff --git a/src/messageview.h b/src/messageview.h index 877064e..56925b2 100644 --- a/src/messageview.h +++ b/src/messageview.h @@ -149,6 +149,15 @@ public: /// of which notmuch reports as an error. SearchOffer selectionSearchOffer(const QString &selectedText) const; + /// Tells the pane whether the query bar currently holds anything. + /// + /// The menus need it to grey out "Exclude from search": excluding from an + /// empty query would mean the whole Maildir minus one value. The pane + /// cannot read the query bar and must not, so the window pushes the fact + /// down as it changes. Passed on to the details dialog at construction, + /// which is built fresh per invocation and so cannot go stale. + void setHasQuery(bool hasQuery) { m_hasQuery = hasQuery; } + public slots: void toggleHtml(); void loadRemoteContent(); @@ -282,4 +291,7 @@ private: /// Populated by updateHeader(), consumed by the header's context menu. QList m_headerOffers; + + /// Whether the query bar holds anything. See setHasQuery(). + bool m_hasQuery = false; }; -- cgit v1.2.3