summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-06 19:13:59 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-06 19:13:59 +0100
commit4de82d8eafdf0ed9fe48f6bc6627c14332f0fc3c (patch)
tree94286d1f64df4bdd0959337fcb4a605516f55077
parentcd206b3a720807301f1b1707698c4a405da89217 (diff)
downloadsink-4de82d8eafdf0ed9fe48f6bc6627c14332f0fc3c.tar.gz
sink-4de82d8eafdf0ed9fe48f6bc6627c14332f0fc3c.zip
Fix copy constructor of SyncScope
We used to loose the resource list and thus erroneously sync all available resources.
-rw-r--r--common/query.h6
-rw-r--r--common/store.cpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/common/query.h b/common/query.h
index 8f69cb7..b69639b 100644
--- a/common/query.h
+++ b/common/query.h
@@ -455,6 +455,7 @@ public:
455 } 455 }
456 456
457private: 457private:
458 friend class SyncScope;
458 int mLimit; 459 int mLimit;
459 Flags mFlags; 460 Flags mFlags;
460 Filter mResourceFilter; 461 Filter mResourceFilter;
@@ -467,8 +468,9 @@ public:
467 468
468 SyncScope() = default; 469 SyncScope() = default;
469 470
470 SyncScope(const QueryBase &other) 471 SyncScope(const Query &other)
471 : QueryBase(other) 472 : QueryBase(other),
473 mResourceFilter(other.mResourceFilter)
472 { 474 {
473 475
474 } 476 }
diff --git a/common/store.cpp b/common/store.cpp
index 477b852..971cc7f 100644
--- a/common/store.cpp
+++ b/common/store.cpp
@@ -289,7 +289,7 @@ static KAsync::Job<void> synchronize(const QByteArray &resource, const Sink::Syn
289 289
290KAsync::Job<void> Store::synchronize(const Sink::Query &query) 290KAsync::Job<void> Store::synchronize(const Sink::Query &query)
291{ 291{
292 return synchronize(Sink::SyncScope{static_cast<Sink::QueryBase>(query)}); 292 return synchronize(Sink::SyncScope{query});
293} 293}
294 294
295KAsync::Job<void> Store::synchronize(const Sink::SyncScope &scope) 295KAsync::Job<void> Store::synchronize(const Sink::SyncScope &scope)