summaryrefslogtreecommitdiffstats
path: root/framework/mail/maillistcontroller.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/maillistcontroller.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/maillistcontroller.cpp')
-rw-r--r--framework/mail/maillistcontroller.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/framework/mail/maillistcontroller.cpp b/framework/mail/maillistcontroller.cpp
index d2e00991..67bfe4fe 100644
--- a/framework/mail/maillistcontroller.cpp
+++ b/framework/mail/maillistcontroller.cpp
@@ -3,7 +3,6 @@
3#include <QStringList> 3#include <QStringList>
4 4
5#include <akonadi2common/clientapi.h> 5#include <akonadi2common/clientapi.h>
6#include <akonadi2common/query.h>
7 6
8#include "maillistmodel.h" 7#include "maillistmodel.h"
9 8
@@ -17,17 +16,26 @@ MailListModel *MailListController::model() const
17 16
18} 17}
19 18
20QString MailListController::query() const 19QString MailListController::folderId() const
21{ 20{
22 return m_query; 21 return m_folderId;
23} 22}
24 23
25void MailListController::setQuery(const QString &query) 24void MailListController::setFolderId(const QString &folderId)
26{ 25{
27 qDebug() << "set query"; 26 if (m_folderId != folderId) {
28 if (m_query != query) { 27 m_folderId = folderId;
29 m_query = query; 28
30 emit queryChanged(); 29
30 Akonadi2::Query query;
31 query.syncOnDemand = false;
32 query.processAll = false;
33 query.liveQuery = true;
34 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important";
35 query.ids << folderId.toLatin1();
36 m_model->runQuery(query);
37
38 emit folderIdChanged();
31 } 39 }
32} 40}
33 41