diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-02 23:15:01 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-02 23:15:01 +0200 |
commit | 581b5a7f16a1c399958742a3b103f47ef9518662 (patch) | |
tree | cc7fa518f81d00522532b223e7373f2f04236f7e /framework/src/entitymodel.cpp | |
parent | 6aa6051a1535db4fea13bbde62e7701ecba583e9 (diff) | |
download | kube-581b5a7f16a1c399958742a3b103f47ef9518662.tar.gz kube-581b5a7f16a1c399958742a3b103f47ef9518662.zip |
Addressbook support for the contact composer
Diffstat (limited to 'framework/src/entitymodel.cpp')
-rw-r--r-- | framework/src/entitymodel.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/framework/src/entitymodel.cpp b/framework/src/entitymodel.cpp index b2d7a9ec..5a79fdf2 100644 --- a/framework/src/entitymodel.cpp +++ b/framework/src/entitymodel.cpp | |||
@@ -60,8 +60,11 @@ void EntityModel::runQuery(const Query &query) | |||
60 | { | 60 | { |
61 | if (mType == "calendar") { | 61 | if (mType == "calendar") { |
62 | mModel = Store::loadModel<Calendar>(query); | 62 | mModel = Store::loadModel<Calendar>(query); |
63 | } else if (mType == "addressbook") { | ||
64 | mModel = Store::loadModel<Addressbook>(query); | ||
63 | } else { | 65 | } else { |
64 | qWarning() << "Type not supported " << mType; | 66 | qWarning() << "Type not supported " << mType; |
67 | Q_ASSERT(false); | ||
65 | } | 68 | } |
66 | setSourceModel(mModel.data()); | 69 | setSourceModel(mModel.data()); |
67 | } | 70 | } |
@@ -139,3 +142,13 @@ QVariantMap EntityModel::filter() const | |||
139 | { | 142 | { |
140 | return {}; | 143 | return {}; |
141 | } | 144 | } |
145 | |||
146 | |||
147 | QVariantMap EntityModel::data(int row) const | ||
148 | { | ||
149 | QVariantMap map; | ||
150 | for (const auto &r : mRoleNames.keys()) { | ||
151 | map.insert(mRoleNames.value(r), data(index(row, 0), r)); | ||
152 | } | ||
153 | return map; | ||
154 | } | ||