summaryrefslogtreecommitdiffstats
path: root/framework/mail/maillistmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/mail/maillistmodel.cpp')
-rw-r--r--framework/mail/maillistmodel.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/framework/mail/maillistmodel.cpp b/framework/mail/maillistmodel.cpp
index 06670e09..baa11bc3 100644
--- a/framework/mail/maillistmodel.cpp
+++ b/framework/mail/maillistmodel.cpp
@@ -35,19 +35,20 @@ QHash< int, QByteArray > MailListModel::roleNames() const
35 35
36QVariant MailListModel::data(const QModelIndex &idx, int role) const 36QVariant MailListModel::data(const QModelIndex &idx, int role) const
37{ 37{
38 auto srcIdx = mapToSource(idx);
38 switch (role) { 39 switch (role) {
39 case Subject: 40 case Subject:
40 return mapToSource(idx).data(Qt::DisplayRole).toString(); 41 return srcIdx.sibling(srcIdx.row(), 0).data(Qt::DisplayRole).toString();
41 case Sender: 42 case Sender:
42 return mapToSource(idx).data(Qt::DisplayRole).toString(); 43 return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString();
43 case SenderName: 44 case SenderName:
44 return mapToSource(idx).data(Qt::DisplayRole).toString(); 45 return srcIdx.sibling(srcIdx.row(), 2).data(Qt::DisplayRole).toString();
45 case Date: 46 case Date:
46 return mapToSource(idx).data(Qt::DisplayRole).toString(); 47 return srcIdx.sibling(srcIdx.row(), 3).data(Qt::DisplayRole).toString();
47 case Unread: 48 case Unread:
48 return mapToSource(idx).data(Qt::DisplayRole).toString(); 49 return srcIdx.sibling(srcIdx.row(), 4).data(Qt::DisplayRole).toString();
49 case Important: 50 case Important:
50 return mapToSource(idx).data(Qt::DisplayRole).toString(); 51 return srcIdx.sibling(srcIdx.row(), 5).data(Qt::DisplayRole).toString();
51 } 52 }
52 return QIdentityProxyModel::data(idx, role); 53 return QIdentityProxyModel::data(idx, role);
53} 54}