diff options
Diffstat (limited to 'framework/mail/maillistcontroller.cpp')
-rw-r--r-- | framework/mail/maillistcontroller.cpp | 24 |
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 | ||
20 | QString MailListController::query() const | 19 | QString MailListController::folderId() const |
21 | { | 20 | { |
22 | return m_query; | 21 | return m_folderId; |
23 | } | 22 | } |
24 | 23 | ||
25 | void MailListController::setQuery(const QString &query) | 24 | void 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 | ||