From a9b086954e17d6f2d64ac94b225577cb0e416f4f Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 22 Feb 2018 15:22:22 +0100 Subject: Use the new changes regarding aggregated properties. This fixes marking partially unread threads as read. --- framework/qml/MailListView.qml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'framework/qml') diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index 69b7d871..35c90618 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml @@ -35,9 +35,6 @@ FocusScope { property bool showFilter: false property string filter: null - onCurrentMailChanged: { - Kube.Fabric.postMessage(Kube.Messages.markAsRead, {"mail": currentMail}) - } onParentFolderChanged: { currentMail = null filterField.clearSearch() @@ -130,11 +127,16 @@ FocusScope { onCurrentItemChanged: { if (currentItem) { - root.currentMail = currentItem.currentData.mail; - root.isDraft = currentItem.currentData.draft; - root.isTrash = currentItem.currentData.trash; - root.isImportant = currentItem.currentData.important; - root.isUnread = currentItem.currentData.unread; + var currentData = currentItem.currentData; + root.currentMail = currentData.mail; + root.isDraft = currentData.draft; + root.isTrash = currentData.trash; + root.isImportant = currentData.important; + root.isUnread = currentData.unread; + + if (currentData.mail && currentData.unread) { + Kube.Fabric.postMessage(Kube.Messages.markAsRead, {"mail": currentData.mail}) + } } } -- cgit v1.2.3