aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_mainwindow.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 /tests/test_mainwindow.cpp
parentae2ae2df75ed780a88423b77af3b31fbe2b26389 (diff)
downloadqtmaildir-thread-row-identity.tar.gz
qtmaildir-thread-row-identity.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 'tests/test_mainwindow.cpp')
-rw-r--r--tests/test_mainwindow.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_mainwindow.cpp b/tests/test_mainwindow.cpp
index aecefb7..2e7d220 100644
--- a/tests/test_mainwindow.cpp
+++ b/tests/test_mainwindow.cpp
@@ -1396,10 +1396,11 @@ void TestMainWindow::aThreadWithRepliesDrawsAVisibleExpander()
const QModelIndex first = model->index(0, 0, QModelIndex());
const QModelIndex second = model->index(1, 0, QModelIndex());
- // Guards: the model agrees about which thread has replies, and only that
- // one is offered an expander at all.
- QCOMPARE(model->data(first, ThreadListModel::ReplyCountRole).toInt(), 2);
- QCOMPARE(model->data(second, ThreadListModel::ReplyCountRole).toInt(), 0);
+ // Guards: the model agrees about which thread has an expander, and only
+ // that one is offered one at all. The count is MESSAGES: the three-message
+ // thread reads 3, the lone message reads 0.
+ QCOMPARE(model->data(first, ThreadListModel::MessageCountRole).toInt(), 3);
+ QCOMPARE(model->data(second, ThreadListModel::MessageCountRole).toInt(), 0);
const QFont font = view->font();
const int height = CardLayout::heightFor(font);