From 4e416d546a68513f05ef10d41d05e0a9c6d5ecf6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 30 Apr 2017 22:49:16 +0200 Subject: Trigger a sync when opening the addressbook --- framework/qml/People.qml | 5 +++++ framework/src/sinkfabric.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/framework/qml/People.qml b/framework/qml/People.qml index d51c9d80..e8a4fca3 100644 --- a/framework/qml/People.qml +++ b/framework/qml/People.qml @@ -32,6 +32,11 @@ Kube.Popup { property var currentContact modal: true + onVisibleChanged: { + if (visible) { + Kube.Fabric.postMessage(Kube.Messages.synchronize, {"type": "contacts"}); + } + } Item { id: peopleRoot diff --git a/framework/src/sinkfabric.cpp b/framework/src/sinkfabric.cpp index 2615a3ca..09075174 100644 --- a/framework/src/sinkfabric.cpp +++ b/framework/src/sinkfabric.cpp @@ -46,6 +46,10 @@ public: auto scope = SyncScope().resourceFilter(folder->resourceInstanceIdentifier()).filter(QVariant::fromValue(folder->identifier())); scope.setType(); Store::synchronize(scope).exec(); + } else if (message["type"].value() == "contacts") { + auto scope = SyncScope(); + scope.setType(); + Store::synchronize(scope).exec(); } else { SinkLog() << "Synchronizing all"; Store::synchronize(SyncScope()).exec(); -- cgit v1.2.3