summaryrefslogtreecommitdiffstats
path: root/framework/mail/maillistcontroller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/mail/maillistcontroller.cpp')
-rw-r--r--framework/mail/maillistcontroller.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/framework/mail/maillistcontroller.cpp b/framework/mail/maillistcontroller.cpp
index ea7d1661..859aed91 100644
--- a/framework/mail/maillistcontroller.cpp
+++ b/framework/mail/maillistcontroller.cpp
@@ -16,17 +16,18 @@ MailListModel *MailListController::model() const
16 16
17} 17}
18 18
19QString MailListController::folderId() const 19void MailListController::loadAllMail()
20{ 20{
21 return m_folderId; 21 Akonadi2::Query query;
22 query.syncOnDemand = false;
23 query.processAll = false;
24 query.liveQuery = true;
25 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important";
26 m_model->runQuery(query);
22} 27}
23 28
24void MailListController::setFolderId(const QString &folderId) 29void MailListController::loadMailFolder(const QString &folderId)
25{ 30{
26 if (m_folderId != folderId) {
27 m_folderId = folderId;
28
29
30 Akonadi2::Query query; 31 Akonadi2::Query query;
31 query.syncOnDemand = false; 32 query.syncOnDemand = false;
32 query.processAll = false; 33 query.processAll = false;
@@ -34,12 +35,26 @@ void MailListController::setFolderId(const QString &folderId)
34 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important" << "folder"; 35 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important" << "folder";
35 query.propertyFilter.insert("folder", folderId.toLatin1()); 36 query.propertyFilter.insert("folder", folderId.toLatin1());
36 m_model->runQuery(query); 37 m_model->runQuery(query);
38}
37 39
38 emit folderIdChanged(); 40void MailListController::loadUnreadMail()
39 } 41{
42 Akonadi2::Query query;
43 query.syncOnDemand = false;
44 query.processAll = false;
45 query.liveQuery = true;
46 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important";
47 query.propertyFilter.insert("unread", true);
48 m_model->runQuery(query);
40} 49}
41 50
42void MailListController::addMail(QString subject) 51void MailListController::loadImportantMail()
43{ 52{
44 qDebug() << "add mail"; 53 Akonadi2::Query query;
54 query.syncOnDemand = false;
55 query.processAll = false;
56 query.liveQuery = true;
57 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important";
58 query.propertyFilter.insert("important", true);
59 m_model->runQuery(query);
45} 60}