From 636c802a4aa7b89af9bb411f9465899c4e182c8a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 13 Feb 2017 23:09:58 +0100 Subject: 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. --- components/package/contents/ui/MailListView.qml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'components/package') 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 import QtQuick.Controls 2.0 import QtQuick.Controls 1.4 as Controls import QtQuick.Layouts 1.1 -import QtQml 2.2 as QtQml import org.kde.kirigami 1.0 as Kirigami @@ -114,6 +113,10 @@ Item { //END keyboard nav currentIndex: root.currentIndex + onCurrentItemChanged: { + root.currentMail = currentItem.currentData.domainObject; + root.isDraft = currentItem.currentData.draft; + } model: KubeFramework.MailListModel { parentFolder: root.parentFolder @@ -122,22 +125,11 @@ Item { delegate: Item { id: origin + property variant currentData: model + width: delegateRoot.width height: delegateRoot.height - QtQml.Binding { - target: root - property: "currentMail" - when: listView.currentIndex == index - value: model.domainObject - } - QtQml.Binding { - target: root - property: "isDraft" - when: listView.currentIndex == index - value: model.draft - } - Item { id: delegateRoot -- cgit v1.2.3