feat: conversation grouping by default (Wino-style) + flatten single-mail threads

- MailListView: default group mode = GroupByThread (was None)
  - robustly applied at EmailTreeModel creation (avoids timing crash)
  - guard onGroupByChanged against null model
- EmailTreeModel.buildThreads: single-message 'threads' now shown as plain
  mail rows under root (no expander/nesting), matching Wino/Outlook behavior;
  only real 2+ message conversations render as collapsible thread groups
This commit is contained in:
2026-08-30 03:20:42 +02:00
parent 11e939b68f
commit 391055e6a1
2 changed files with 16 additions and 1 deletions
+6 -1
View File
@@ -149,6 +149,8 @@ void MailListView::setupUI()
);
connect(m_groupByCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &MailListView::onGroupByChanged);
// Default to conversation grouping (Wino-style), index 2 = GroupByThread
m_groupByCombo->setCurrentIndex(2);
filterLayout->addWidget(m_groupByCombo);
layout->addWidget(filterBar);
@@ -244,6 +246,8 @@ void MailListView::setupUI()
);
m_treeModel = new EmailTreeModel(this);
// Wino-style default: group inbox by conversation (thread)
m_treeModel->setGroupMode(EmailTreeModel::GroupByThread);
m_proxyModel = new QSortFilterProxyModel(this);
m_proxyModel->setSourceModel(m_treeModel);
m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
@@ -528,6 +532,7 @@ void MailListView::onFilterChanged()
void MailListView::onGroupByChanged(int index)
{
if (!m_treeModel) return;
switch (index) {
case 0: // Sin agrupación
m_treeModel->setGroupMode(EmailTreeModel::NoGrouping);
@@ -542,7 +547,7 @@ void MailListView::onGroupByChanged(int index)
m_treeModel->setGroupMode(EmailTreeModel::GroupBySender);
break;
}
m_treeView->expandAll();
if (m_treeView) m_treeView->expandAll();
}
void MailListView::onDisplayModeChanged(int index)