diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-14 18:02:38 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-14 18:02:38 +0200 |
| commit | 612eb64871de7e00f21a9b7ebf33d8179caa16bc (patch) | |
| tree | c92f928df38ae87fd233967301e01c6ef5b4dcd6 /src/messageview.h | |
| parent | 78b3a9c1769d37ff7344360b6fed66b12b2f0649 (diff) | |
| download | qtmaildir-612eb64871de7e00f21a9b7ebf33d8179caa16bc.tar.gz qtmaildir-612eb64871de7e00f21a9b7ebf33d8179caa16bc.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'src/messageview.h')
| -rw-r--r-- | src/messageview.h | 12 |
1 files changed, 12 insertions, 0 deletions
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<SearchOffer> m_headerOffers; + + /// Whether the query bar holds anything. See setHasQuery(). + bool m_hasQuery = false; }; |
