From 629e354ebc7d8b19ddd57f9da2a3538eea27f148 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 25 Apr 2017 14:16:41 +0200 Subject: Only select a folder if a user triggered it This avoids selecting all folders once during initial loading of the model --- framework/qml/FolderListView.qml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'framework') diff --git a/framework/qml/FolderListView.qml b/framework/qml/FolderListView.qml index 42841221..c2e7f052 100644 --- a/framework/qml/FolderListView.qml +++ b/framework/qml/FolderListView.qml @@ -51,13 +51,15 @@ Rectangle { accountId: root.accountId } - onCurrentIndexChanged: { - model.fetchMore(currentIndex) - Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder":model.data(currentIndex, Kube.FolderListModel.DomainObject), - "trash":model.data(currentIndex, Kube.FolderListModel.Trash)}) - Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder":model.data(currentIndex, Kube.FolderListModel.DomainObject)}) - console.error(model.data) + onActivated: { + //TODO do some event compression in case of double clicks + model.fetchMore(currentIndex); + Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": model.data(index, Kube.FolderListModel.DomainObject), + "trash": model.data(index, Kube.FolderListModel.Trash)}); + Kube.Fabric.postMessage(Kube.Messages.synchronize, {"folder": model.data(index, Kube.FolderListModel.DomainObject)}); } + //Forward the signal because on a desktopsystem activated is only triggerd by double clicks + onClicked: treeView.activated(index) alternatingRowColors: false headerVisible: false -- cgit v1.2.3