summaryrefslogtreecommitdiffstats
path: root/framework/mail/maillistmodel.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-08 14:14:15 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-08 14:14:15 +0100
commit394d3d9803c101014fb7f521155b0a9ed6809454 (patch)
tree7ef3dd33192c0a4ee299581ec41a9f94fac21cca /framework/mail/maillistmodel.cpp
parentcdb9f957d24ebb255c3eb6b6034da9a8a403f65c (diff)
downloadkube-394d3d9803c101014fb7f521155b0a9ed6809454.tar.gz
kube-394d3d9803c101014fb7f521155b0a9ed6809454.zip
Fixed mapping to result model
The result model exposes the different properties as columns
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}