diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2015-12-08 17:51:24 +0100 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2015-12-08 17:51:24 +0100 |
commit | 40dfb94d6443bb61ed349eb5c2bd483c876b1d23 (patch) | |
tree | 129c90881ede770b397720fa0c9569f76a99eda3 | |
parent | 394d3d9803c101014fb7f521155b0a9ed6809454 (diff) | |
download | kube-40dfb94d6443bb61ed349eb5c2bd483c876b1d23.tar.gz kube-40dfb94d6443bb61ed349eb5c2bd483c876b1d23.zip |
add Id role to folderlist model
-rw-r--r-- | framework/mail/folderlistmodel.cpp | 4 | ||||
-rw-r--r-- | framework/mail/folderlistmodel.h | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/framework/mail/folderlistmodel.cpp b/framework/mail/folderlistmodel.cpp index b0969060..86633de4 100644 --- a/framework/mail/folderlistmodel.cpp +++ b/framework/mail/folderlistmodel.cpp | |||
@@ -1,5 +1,6 @@ | |||
1 | #include "folderlistmodel.h" | 1 | #include "folderlistmodel.h" |
2 | #include <akonadi2common/clientapi.h> | 2 | #include <akonadi2common/clientapi.h> |
3 | #include <akonadi2common/applicationdomaintype.h> | ||
3 | 4 | ||
4 | FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel() | 5 | FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel() |
5 | { | 6 | { |
@@ -23,6 +24,7 @@ QHash< int, QByteArray > FolderListModel::roleNames() const | |||
23 | 24 | ||
24 | roles[Name] = "name"; | 25 | roles[Name] = "name"; |
25 | roles[Icon] = "icon"; | 26 | roles[Icon] = "icon"; |
27 | roles[Id] = "id"; | ||
26 | 28 | ||
27 | return roles; | 29 | return roles; |
28 | } | 30 | } |
@@ -35,6 +37,8 @@ QVariant FolderListModel::data(const QModelIndex &idx, int role) const | |||
35 | return srcIdx.sibling(srcIdx.row(), 0).data(Qt::DisplayRole).toString(); | 37 | return srcIdx.sibling(srcIdx.row(), 0).data(Qt::DisplayRole).toString(); |
36 | case Icon: | 38 | case Icon: |
37 | return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString(); | 39 | return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString(); |
40 | case Id: | ||
41 | return QString("some id"); | ||
38 | } | 42 | } |
39 | return QIdentityProxyModel::data(idx, role); | 43 | return QIdentityProxyModel::data(idx, role); |
40 | } | 44 | } |
diff --git a/framework/mail/folderlistmodel.h b/framework/mail/folderlistmodel.h index 9a782327..829bebff 100644 --- a/framework/mail/folderlistmodel.h +++ b/framework/mail/folderlistmodel.h | |||
@@ -17,7 +17,8 @@ public: | |||
17 | 17 | ||
18 | enum Roles { | 18 | enum Roles { |
19 | Name = Qt::UserRole + 1, | 19 | Name = Qt::UserRole + 1, |
20 | Icon | 20 | Icon, |
21 | Id | ||
21 | }; | 22 | }; |
22 | 23 | ||
23 | QHash<int, QByteArray> roleNames() const; | 24 | QHash<int, QByteArray> roleNames() const; |