From d148e90c04c4c0f2df290942c7711f159b7ba148 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 9 Dec 2015 19:46:13 +0100 Subject: introduce slots to set special queries and adjust folderlsitview accordingly --- framework/mail/maillistcontroller.cpp | 37 ++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'framework/mail/maillistcontroller.cpp') 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 } -QString MailListController::folderId() const +void MailListController::loadAllMail() { - return m_folderId; + Akonadi2::Query query; + query.syncOnDemand = false; + query.processAll = false; + query.liveQuery = true; + query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important"; + m_model->runQuery(query); } -void MailListController::setFolderId(const QString &folderId) +void MailListController::loadMailFolder(const QString &folderId) { - if (m_folderId != folderId) { - m_folderId = folderId; - - Akonadi2::Query query; query.syncOnDemand = false; query.processAll = false; @@ -34,12 +35,26 @@ void MailListController::setFolderId(const QString &folderId) query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important" << "folder"; query.propertyFilter.insert("folder", folderId.toLatin1()); m_model->runQuery(query); +} - emit folderIdChanged(); - } +void MailListController::loadUnreadMail() +{ + Akonadi2::Query query; + query.syncOnDemand = false; + query.processAll = false; + query.liveQuery = true; + query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important"; + query.propertyFilter.insert("unread", true); + m_model->runQuery(query); } -void MailListController::addMail(QString subject) +void MailListController::loadImportantMail() { - qDebug() << "add mail"; + Akonadi2::Query query; + query.syncOnDemand = false; + query.processAll = false; + query.liveQuery = true; + query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important"; + query.propertyFilter.insert("important", true); + m_model->runQuery(query); } -- cgit v1.2.3