diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-28 17:56:25 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-28 17:56:25 +0200 |
| commit | a346bef6c08e9725f3ab41f8237f01e9eb69eea7 (patch) | |
| tree | ca3ea16c23da8971d6b9f8f7d4867845e5c25e0c /src/mainwindow.h | |
| parent | f934029d3333396bde6ec306ab300641929c7cdc (diff) | |
| download | qtmaildir-a346bef6c08e9725f3ab41f8237f01e9eb69eea7.tar.gz qtmaildir-a346bef6c08e9725f3ab41f8237f01e9eb69eea7.zip | |
feat: judge a row's membership on the thread's union
Closes item 170 under item 177. A conversation belongs to a view while any
of its messages match, so reading one message of a thread no longer takes
the conversation out of the Unread view. The current row is never evicted,
and an automatic write defers its eviction until the selection moves.
Diffstat (limited to 'src/mainwindow.h')
| -rw-r--r-- | src/mainwindow.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h index fa413fe..0999ef3 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -235,6 +235,16 @@ public: sendMessageTagChange(messageIds, add, remove, description); } + /// Sends a thread-scoped tag change directly. The counterpart seam to + /// sendMessageTagChangeForTesting, for the same reason. + void sendThreadTagChangeForTesting(const QStringList &threadIds, + const QStringList &add, + const QStringList &remove, + const QString &description) + { + sendThreadTagChange(threadIds, add, remove, description); + } + /// The ids the last tag change was sent for, and whether they were thread /// ids or message ids. /// @@ -1191,6 +1201,29 @@ private: /// firing in a view it cannot judge. QString viewFilterTag() const; + /// Keeps the current view's membership in step with a write: drops a row + /// whose UNION has stopped matching, and refreshes when one starts + /// matching, which the model cannot express on its own. No-op unless the + /// view has a filter tag and the write touched it. + void syncViewMembership(const QStringList &threadIds, + bool aRowIsMissing, + const QStringList &added, + const QStringList &removed); + + /// Removes the rows that stopped matching the view while the user was + /// sitting on them. Called when the selection moves. + void flushDeferredEviction(); + + /// Threads that have stopped matching the view but were selected when it + /// happened, so evicting them would have moved the list under the user. + QStringList m_deferredEvictions; + + /// True only while an AUTOMATIC write is being sent. A write the user + /// asked for evicts its row at once; one a timer made must not, or the row + /// leaves under an open context menu two seconds after it was selected. + /// The distinction is who initiated it, not what it does (item 177). + bool m_automaticWrite = false; + void onMessagesMoved(const QMap<QString, QString> &originByMessageId, const QString &destFolder); |
