aboutsummaryrefslogtreecommitdiffstats
path: root/src/carddelegate.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-28 20:46:44 +0200
committerDanilo M. <danix@danix.xyz>2026-08-28 20:46:44 +0200
commitd7c4d03f7d583767bc23406579e11bcc884dec18 (patch)
treeabe49fa75cb88d768a892cc11a8c2258869ead85 /src/carddelegate.cpp
parentae2ae2df75ed780a88423b77af3b31fbe2b26389 (diff)
downloadqtmaildir-d7c4d03f7d583767bc23406579e11bcc884dec18.tar.gz
qtmaildir-d7c4d03f7d583767bc23406579e11bcc884dec18.zip
feat: count a card's messages, not its repliesthread-row-identity
The expander pill read "N replies" while the row stood for the conversation: a thread of one message and four replies said "4 replies" over rows that listed all five messages. The user's model is messages, so it now reads "5 messages". A thread of one still shows nothing: its row is the message, the pill is the expander, and there is nothing to open. ReplyCountRole becomes MessageCountRole and CardLayout::Input::replyCount becomes messageCount, so the names stop lying about what they carry. The label is now translated under a CardLayout context, with Italian "messaggio"/"messaggi" shipped; %n's untranslated fallback on this Qt does not pluralise, so the two forms are separate entries. The card's densest geometry test needs 460px rather than 400 now that the pill is one character wider.
Diffstat (limited to 'src/carddelegate.cpp')
-rw-r--r--src/carddelegate.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/carddelegate.cpp b/src/carddelegate.cpp
index fbdf13f..02f1df0 100644
--- a/src/carddelegate.cpp
+++ b/src/carddelegate.cpp
@@ -40,7 +40,7 @@ CardLayout::Input inputFor(const QModelIndex &index)
CardLayout::Input in;
in.isMessage = index.data(ThreadListModel::IsMessageRole).toBool();
in.depth = index.data(ThreadListModel::MessageDepthRole).toInt();
- in.replyCount = index.data(ThreadListModel::ReplyCountRole).toInt();
+ in.messageCount = index.data(ThreadListModel::MessageCountRole).toInt();
in.dateFormat = index.data(ThreadListModel::DateFormatRole).toString();
// Item 70's marks. The layout reserves a rect for each, so these have to
@@ -305,14 +305,14 @@ void CardDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
drawMark(card.receivedForwardRect, Marks::Mark::ReceivedForward);
drawMark(card.repliedRect, Marks::Mark::Replied);
- // The reply count, which is also the expander, drawn as a PILL.
+ // The message count, which is also the expander, drawn as a PILL.
//
// A bare "3" on the card's own background read as an unexplained number
// beside the subject and gave no hint that it could be clicked. The chip
// shape says "this is a control", matching the tag chips on line 3, and the
// word says what the number counts.
if (!card.expanderRect.isEmpty()) {
- const int count = index.data(ThreadListModel::ReplyCountRole).toInt();
+ const int count = index.data(ThreadListModel::MessageCountRole).toInt();
const QString label = CardLayout::expanderLabel(
count, option.state & QStyle::State_Open);