From d7c4d03f7d583767bc23406579e11bcc884dec18 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 28 Aug 2026 20:46:44 +0200 Subject: feat: count a card's messages, not its replies 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. --- tests/test_mainwindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/test_mainwindow.cpp') 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); -- cgit v1.2.3