summaryrefslogtreecommitdiffstats
path: root/framework/mail/maillistmodel.cpp
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2015-12-08 18:32:41 +0100
committerMichael Bohlender <michael.bohlender@kdemail.net>2015-12-08 18:32:41 +0100
commit727be50d12e4366df6add54d9e9fb249352316f6 (patch)
treeca385f2cafdf07c53f8eb745f163f0538c934abe /framework/mail/maillistmodel.cpp
parent09de3c5275e0eabe9a13ccfefeb230f69b89dff4 (diff)
downloadkube-727be50d12e4366df6add54d9e9fb249352316f6.tar.gz
kube-727be50d12e4366df6add54d9e9fb249352316f6.zip
maillist controller now accepts folderIds, creates a query and loads the model
Diffstat (limited to 'framework/mail/maillistmodel.cpp')
-rw-r--r--framework/mail/maillistmodel.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/framework/mail/maillistmodel.cpp b/framework/mail/maillistmodel.cpp
index baa11bc3..144c1970 100644
--- a/framework/mail/maillistmodel.cpp
+++ b/framework/mail/maillistmodel.cpp
@@ -1,17 +1,9 @@
1#include "maillistmodel.h" 1#include "maillistmodel.h"
2#include <akonadi2common/clientapi.h>
3
4 2
5MailListModel::MailListModel(QObject *parent) 3MailListModel::MailListModel(QObject *parent)
6 : QIdentityProxyModel() 4 : QIdentityProxyModel()
7{ 5{
8 Akonadi2::Query query; 6
9 query.syncOnDemand = false;
10 query.processAll = false;
11 query.liveQuery = true;
12 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important";
13 mModel = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query);
14 setSourceModel(mModel.data());
15} 7}
16 8
17MailListModel::~MailListModel() 9MailListModel::~MailListModel()
@@ -53,7 +45,9 @@ QVariant MailListModel::data(const QModelIndex &idx, int role) const
53 return QIdentityProxyModel::data(idx, role); 45 return QIdentityProxyModel::data(idx, role);
54} 46}
55 47
56void MailListModel::runQuery(const QString& query) 48void MailListModel::runQuery(const Akonadi2::Query &query)
57{ 49{
50 m_model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query);
51 setSourceModel(m_model.data());
58} 52}
59 53