aboutsummaryrefslogtreecommitdiffstats
path: root/src/threadcidmap.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-08 10:35:06 +0200
committerDanilo M. <danix@danix.xyz>2026-08-08 10:35:06 +0200
commit78733fbc5ab8c1d4707444b5bce3990dbc0a9fcb (patch)
tree4eacd2849ba501ce1c7c28ffc700bee06d63c9c7 /src/threadcidmap.cpp
parent39c3863b8c7fc6130890ab06fa4303eeddad3162 (diff)
downloadqtmaildir-78733fbc5ab8c1d4707444b5bce3990dbc0a9fcb.tar.gz
qtmaildir-78733fbc5ab8c1d4707444b5bce3990dbc0a9fcb.zip
refactor(view): make ThreadListView a QTreeView for message rows
The strip survived the port because every geometry call it needs exists on both classes. What did not survive is anything keyed on a row NUMBER: a tree numbers rows per parent, so row 0 exists once per expanded thread and the old flat 0..N walk would paint the first thread's strip over every one of them. The walk now goes by index, and the alternating colour follows visual position rather than index.row() for the same reason. QTableView::isRowSelected(int) has no QTreeView equivalent; isSelected on the index replaces it. MainWindow loses verticalHeader and selectRow, so row height comes from uniformRowHeights and three helpers replace the row arithmetic. next_thread and prev_thread now resolve the containing thread first: in a tree current.row() + 1 is the next SIBLING, which under an expanded thread is the next reply, not the next thread. Two test defects found by mutation and worth recording, since both produced a green suite over a broken assertion: The indent test asserted on column 0. A QTreeView indents only the column holding the expander, verified against Qt 6.11: with setTreePosition(4), column 0 reports the same left edge for a thread and its reply while column 4 reports 420 against 440. It was failing against a correctly indented tree. The strip test passed with the view's skip deleted, because the real model already returns no pills for a child row, so the view's guard was never the thing under test. It now runs against a stub model that hands pills to every row, which leaves the view's skip as the only thing that can keep replies clean. That rewrite then failed for a third reason: without the delegates MainWindow installs, rows take the default height, the band is measured against SubjectDelegate::rowHeightFor and overflows into the row below, and the thread's own strip paints across the reply. Reads exactly like a missing skip and is not one.
Diffstat (limited to 'src/threadcidmap.cpp')
0 files changed, 0 insertions, 0 deletions