summaryrefslogtreecommitdiffstats
path: root/common/store.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-15 14:44:28 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-15 15:19:41 +0100
commit5dab398f76b2d2c6dfdce9ee068c226c9ab20e5b (patch)
tree9adbf1f86e7d0feeb7ba104c924ac482400c6f91 /common/store.cpp
parentd838e58a3fd94a04d9db82560f7004433300b77e (diff)
downloadsink-5dab398f76b2d2c6dfdce9ee068c226c9ab20e5b.tar.gz
sink-5dab398f76b2d2c6dfdce9ee068c226c9ab20e5b.zip
Support syncing all resources
Diffstat (limited to 'common/store.cpp')
-rw-r--r--common/store.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/store.cpp b/common/store.cpp
index 68f73c8..2c1dcad 100644
--- a/common/store.cpp
+++ b/common/store.cpp
@@ -45,7 +45,7 @@ QString Store::storageLocation()
45 return Sink::storageLocation(); 45 return Sink::storageLocation();
46} 46}
47 47
48static QList<QByteArray> getResources(const QList<QByteArray> &resourceFilter, const QByteArray &type) 48static QList<QByteArray> getResources(const QList<QByteArray> &resourceFilter, const QByteArray &type = QByteArray())
49{ 49{
50 // Return the global resource (signified by an empty name) for types that don't eblong to a specific resource 50 // Return the global resource (signified by an empty name) for types that don't eblong to a specific resource
51 if (type == "sinkresource") { 51 if (type == "sinkresource") {
@@ -163,7 +163,8 @@ KAsync::Job<void> Store::removeDataFromDisk(const QByteArray &identifier)
163KAsync::Job<void> Store::synchronize(const Sink::Query &query) 163KAsync::Job<void> Store::synchronize(const Sink::Query &query)
164{ 164{
165 Trace() << "synchronize" << query.resources; 165 Trace() << "synchronize" << query.resources;
166 return KAsync::iterate(query.resources) 166 auto resources = getResources(query.resources);
167 return KAsync::iterate(resources)
167 .template each<void, QByteArray>([query](const QByteArray &resource, KAsync::Future<void> &future) { 168 .template each<void, QByteArray>([query](const QByteArray &resource, KAsync::Future<void> &future) {
168 Trace() << "Synchronizing " << resource; 169 Trace() << "Synchronizing " << resource;
169 auto resourceAccess = ResourceAccessFactory::instance().getAccess(resource); 170 auto resourceAccess = ResourceAccessFactory::instance().getAccess(resource);