summaryrefslogtreecommitdiffstats
path: root/framework/src/entitymodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/entitymodel.cpp')
-rw-r--r--framework/src/entitymodel.cpp13
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
147QVariantMap 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}