summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-13 23:09:58 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-13 23:09:58 +0100
commit636c802a4aa7b89af9bb411f9465899c4e182c8a (patch)
treea482d775a8fe265c8234bcb8f67cd0a34aa1425d
parentf33590064be8de3270f4af438414e25600b45e68 (diff)
downloadkube-636c802a4aa7b89af9bb411f9465899c4e182c8a.tar.gz
kube-636c802a4aa7b89af9bb411f9465899c4e182c8a.zip
Use currentItem to bind the current mail
The binding would occasionally result in temporary changes resulting in a lot of queries for the conversationview during a sync. currentItem works a lot better that way is also a generally cleaner solution.
-rw-r--r--components/package/contents/ui/MailListView.qml20
1 files changed, 6 insertions, 14 deletions
diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml
index a26dcc2b..3f0ebcaa 100644
--- a/components/package/contents/ui/MailListView.qml
+++ b/components/package/contents/ui/MailListView.qml
@@ -20,7 +20,6 @@ import QtQuick 2.7
20import QtQuick.Controls 2.0 20import QtQuick.Controls 2.0
21import QtQuick.Controls 1.4 as Controls 21import QtQuick.Controls 1.4 as Controls
22import QtQuick.Layouts 1.1 22import QtQuick.Layouts 1.1
23import QtQml 2.2 as QtQml
24 23
25import org.kde.kirigami 1.0 as Kirigami 24import org.kde.kirigami 1.0 as Kirigami
26 25
@@ -114,6 +113,10 @@ Item {
114 //END keyboard nav 113 //END keyboard nav
115 114
116 currentIndex: root.currentIndex 115 currentIndex: root.currentIndex
116 onCurrentItemChanged: {
117 root.currentMail = currentItem.currentData.domainObject;
118 root.isDraft = currentItem.currentData.draft;
119 }
117 120
118 model: KubeFramework.MailListModel { 121 model: KubeFramework.MailListModel {
119 parentFolder: root.parentFolder 122 parentFolder: root.parentFolder
@@ -122,22 +125,11 @@ Item {
122 delegate: Item { 125 delegate: Item {
123 id: origin 126 id: origin
124 127
128 property variant currentData: model
129
125 width: delegateRoot.width 130 width: delegateRoot.width
126 height: delegateRoot.height 131 height: delegateRoot.height
127 132
128 QtQml.Binding {
129 target: root
130 property: "currentMail"
131 when: listView.currentIndex == index
132 value: model.domainObject
133 }
134 QtQml.Binding {
135 target: root
136 property: "isDraft"
137 when: listView.currentIndex == index
138 value: model.draft
139 }
140
141 Item { 133 Item {
142 id: delegateRoot 134 id: delegateRoot
143 135