diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-19 22:43:01 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-19 22:43:01 +0100 |
commit | 9e8d4bac334e727368ada48676a21d52030b97cc (patch) | |
tree | 28ca211e866d82368f6b6a28ae0513d38f381da2 | |
parent | 6d4c826db6d40ede3199c2f618d63792714d90dc (diff) | |
download | sink-9e8d4bac334e727368ada48676a21d52030b97cc.tar.gz sink-9e8d4bac334e727368ada48676a21d52030b97cc.zip |
We need the resource filter API also for SyncScope
-rw-r--r-- | common/query.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/common/query.h b/common/query.h index 8e9050d..49c8d5e 100644 --- a/common/query.h +++ b/common/query.h | |||
@@ -509,6 +509,31 @@ public: | |||
509 | } | 509 | } |
510 | 510 | ||
511 | template <typename T> | 511 | template <typename T> |
512 | SyncScope &resourceFilter(const ApplicationDomain::ApplicationDomainType &entity) | ||
513 | { | ||
514 | mResourceFilter.propertyFilter.insert(T::name, Comparator(entity.identifier())); | ||
515 | return *this; | ||
516 | } | ||
517 | |||
518 | SyncScope &resourceFilter(const QByteArray &name, const Comparator &comparator) | ||
519 | { | ||
520 | mResourceFilter.propertyFilter.insert(name, comparator); | ||
521 | return *this; | ||
522 | } | ||
523 | |||
524 | template <typename T> | ||
525 | SyncScope &resourceContainsFilter(const QVariant &value) | ||
526 | { | ||
527 | return resourceFilter(T::name, Comparator(value, Comparator::Contains)); | ||
528 | } | ||
529 | |||
530 | template <typename T> | ||
531 | SyncScope &resourceFilter(const QVariant &value) | ||
532 | { | ||
533 | return resourceFilter(T::name, value); | ||
534 | } | ||
535 | |||
536 | template <typename T> | ||
512 | SyncScope &filter(const Query::Comparator &comparator) | 537 | SyncScope &filter(const Query::Comparator &comparator) |
513 | { | 538 | { |
514 | return filter(T::name, comparator); | 539 | return filter(T::name, comparator); |