From 21aea475143492618d90dbbdeee0281c8b010f24 Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Wed, 4 May 2016 23:31:28 +0300 Subject: [PATCH] [ubuntu] Wait half a second before marking articles as read Besides being a reasonable thing, this helps working around a problem where the first article of a feed would always be marked as read even when the user opened another item (because currentIndex is always changed to 0 as soon as the model is ready). --- qml/ttrss/ubuntu-touch/FeedItemSwipe.qml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/qml/ttrss/ubuntu-touch/FeedItemSwipe.qml b/qml/ttrss/ubuntu-touch/FeedItemSwipe.qml index 5e9fdb3..e078b63 100644 --- a/qml/ttrss/ubuntu-touch/FeedItemSwipe.qml +++ b/qml/ttrss/ubuntu-touch/FeedItemSwipe.qml @@ -65,9 +65,8 @@ Page { onCurrentIndexChanged: { model.selectedIndex = currentIndex - if (currentItem && settings.autoMarkRead && currentItem.unread) { - console.log("marking item as read") - model.toggleRead() + if (settings.autoMarkRead) { + readTimer.restart() } panel.close() } @@ -81,6 +80,16 @@ Page { listView.highlightFollowsCurrentItem = true } + Timer { + id: readTimer + interval: 500 + repeat: false + onTriggered: if (currentItem && currentItem.unread) { + console.log("marking item as read") + model.toggleRead() + } + } + Panel { id: panel anchors {