diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-08 10:24:16 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-10 08:23:06 +0200 |
| commit | c80c060a593fb802f7149223d0d2f8495bc1f443 (patch) | |
| tree | 752e073bc845eed021b57719350b60d20a9ae488 /src/threadlistmodel.h | |
| parent | 879a117cba62df57dfcb0c0dfd4383308fa07f13 (diff) | |
| download | qtmaildir-c80c060a593fb802f7149223d0d2f8495bc1f443.tar.gz qtmaildir-c80c060a593fb802f7149223d0d2f8495bc1f443.zip | |
feat(model): resolve action scope from the selected row kind
ActionScope is what an action is about to touch, resolved from the selection in
one place so no call site reinvents the mapping. A thread root contributes the
whole thread, a message row contributes one message, and messageCount is what
the status bar reports.
The count comes from totalCount, not from the loaded children. A thread that was
never expanded still has all of its messages, and counting only the rows that
happen to be on screen would understate what the action does: mutation-checked,
and the wrong version reports 1 message where 7 are about to be tagged.
A mixed selection is honoured as given rather than escalated to thread scope or
narrowed to message scope. Silently widening it would defeat the reason the
scope is shown at all.
Diffstat (limited to 'src/threadlistmodel.h')
| -rw-r--r-- | src/threadlistmodel.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/threadlistmodel.h b/src/threadlistmodel.h index a7ce5d3..bc9fcbf 100644 --- a/src/threadlistmodel.h +++ b/src/threadlistmodel.h @@ -160,6 +160,14 @@ public: /// is not a message row. MessageNode messageAt(const QModelIndex &index) const; + /// Resolves a selection into what an action should touch. + /// + /// Mixed selections are honoured as given: a thread root and an unrelated + /// reply act on that whole thread and that one message. Nothing is + /// escalated or narrowed silently, which is the point of the scope being + /// visible in the first place. + ActionScope scopeFor(const QModelIndexList &selection) const; + /// The account keys behind a thread's account tags, for item 49's /// per-account sync. /// |
