summaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/qml/ModelIndexRetriever.qml9
-rw-r--r--framework/qmldir1
-rw-r--r--framework/src/domain/maillistmodel.cpp40
-rw-r--r--framework/src/domain/maillistmodel.h5
4 files changed, 53 insertions, 2 deletions
diff --git a/framework/qml/ModelIndexRetriever.qml b/framework/qml/ModelIndexRetriever.qml
index fa3fb64b..d01ceb71 100644
--- a/framework/qml/ModelIndexRetriever.qml
+++ b/framework/qml/ModelIndexRetriever.qml
@@ -21,11 +21,16 @@ import QtQuick 2.4
21Repeater { 21Repeater {
22 id: root 22 id: root
23 property var currentData 23 property var currentData
24 property int currentIndex: 0
25 onCurrentIndexChanged: {
26 currentData = itemAt(currentIndex).currentData
27 }
24 Item { 28 Item {
25 id: delegate
26 property var currentData: model 29 property var currentData: model
27 onCurrentDataChanged: { 30 onCurrentDataChanged: {
28 root.currentData = model 31 if (index == root.currentIndex) {
32 root.currentData = model
33 }
29 } 34 }
30 visible: false 35 visible: false
31 } 36 }
diff --git a/framework/qmldir b/framework/qmldir
index 748b77f7..b94abc28 100644
--- a/framework/qmldir
+++ b/framework/qmldir
@@ -4,6 +4,7 @@ ConversationView 1.0 ConversationView.qml
4ConversationListView 1.0 ConversationListView.qml 4ConversationListView 1.0 ConversationListView.qml
5FolderListView 1.0 FolderListView.qml 5FolderListView 1.0 FolderListView.qml
6MailListView 1.0 MailListView.qml 6MailListView 1.0 MailListView.qml
7MailViewer 1.0 MailViewer.qml
7InlineAccountSwitcher 1.0 InlineAccountSwitcher.qml 8InlineAccountSwitcher 1.0 InlineAccountSwitcher.qml
8NewAccountDialog 1.0 NewAccountDialog.qml 9NewAccountDialog 1.0 NewAccountDialog.qml
9EditAccount 1.0 EditAccount.qml 10EditAccount 1.0 EditAccount.qml
diff --git a/framework/src/domain/maillistmodel.cpp b/framework/src/domain/maillistmodel.cpp
index 83fd37ff..4b70a10a 100644
--- a/framework/src/domain/maillistmodel.cpp
+++ b/framework/src/domain/maillistmodel.cpp
@@ -339,3 +339,43 @@ bool MailListModel::showDrafts() const
339{ 339{
340 return false; 340 return false;
341} 341}
342
343void MailListModel::setShowInbox(bool)
344{
345 using namespace Sink::ApplicationDomain;
346
347 Sink::Query folderQuery{};
348 folderQuery.containsFilter<Sink::ApplicationDomain::Folder::SpecialPurpose>(Sink::ApplicationDomain::SpecialPurpose::Mail::inbox);
349 folderQuery.request<Sink::ApplicationDomain::Folder::SpecialPurpose>();
350 folderQuery.request<Sink::ApplicationDomain::Folder::Name>();
351
352 Sink::Query query;
353 query.setFlags(Sink::Query::LiveQuery);
354 query.filter<Sink::ApplicationDomain::Mail::Folder>(folderQuery);
355 query.sort<Mail::Date>();
356 query.request<Mail::Subject>();
357 query.request<Mail::Sender>();
358 query.request<Mail::To>();
359 query.request<Mail::Cc>();
360 query.request<Mail::Bcc>();
361 query.request<Mail::Date>();
362 query.request<Mail::Unread>();
363 query.request<Mail::Important>();
364 query.request<Mail::Draft>();
365 query.request<Mail::Folder>();
366 query.request<Mail::Sent>();
367 query.request<Mail::Trash>();
368 query.request<Mail::MimeMessage>();
369 query.request<Mail::FullPayloadAvailable>();
370 mFetchMails = true;
371 mFetchedMails.clear();
372 qDebug() << "Running mail query for drafts: ";
373 //Latest mail at the top
374 sort(0, Qt::DescendingOrder);
375 runQuery(query);
376}
377
378bool MailListModel::showInbox() const
379{
380 return false;
381}
diff --git a/framework/src/domain/maillistmodel.h b/framework/src/domain/maillistmodel.h
index 5f593700..ce0399f7 100644
--- a/framework/src/domain/maillistmodel.h
+++ b/framework/src/domain/maillistmodel.h
@@ -32,6 +32,8 @@ class MailListModel : public QSortFilterProxyModel
32 Q_PROPERTY (QVariant parentFolder READ parentFolder WRITE setParentFolder) 32 Q_PROPERTY (QVariant parentFolder READ parentFolder WRITE setParentFolder)
33 Q_PROPERTY (QVariant mail READ mail WRITE setMail) 33 Q_PROPERTY (QVariant mail READ mail WRITE setMail)
34 Q_PROPERTY (bool showDrafts READ showDrafts WRITE setShowDrafts) 34 Q_PROPERTY (bool showDrafts READ showDrafts WRITE setShowDrafts)
35 Q_PROPERTY (bool showInbox READ showInbox WRITE setShowInbox)
36
35 Q_PROPERTY (QString filter READ filter WRITE setFilter) 37 Q_PROPERTY (QString filter READ filter WRITE setFilter)
36 Q_PROPERTY (bool isThreaded READ isThreaded NOTIFY isThreadedChanged) 38 Q_PROPERTY (bool isThreaded READ isThreaded NOTIFY isThreadedChanged)
37 39
@@ -91,6 +93,9 @@ public:
91 void setShowDrafts(bool); 93 void setShowDrafts(bool);
92 bool showDrafts() const; 94 bool showDrafts() const;
93 95
96 void setShowInbox(bool);
97 bool showInbox() const;
98
94signals: 99signals:
95 void isThreadedChanged(); 100 void isThreadedChanged();
96 101