diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-10-04 08:25:18 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-10-04 08:25:18 +0200 |
commit | d6a01b3f82d626856001356c0875aa738a0346ac (patch) | |
tree | d77a6000e9d53be7844d72697496efa093b5f8ad /common/query.cpp | |
parent | 48ba18c92eede967afc4cf8894a3b06fd6a3c179 (diff) | |
download | sink-d6a01b3f82d626856001356c0875aa738a0346ac.tar.gz sink-d6a01b3f82d626856001356c0875aa738a0346ac.zip |
Support for subqueries.
This allows us to match properties from a subquery.
Unfortunately this also means that DataStoreQuery needs access to all
type implementations to issue the subquery (for potentially another type).
Diffstat (limited to 'common/query.cpp')
-rw-r--r-- | common/query.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/query.cpp b/common/query.cpp index 3de80d8..a43ef6c 100644 --- a/common/query.cpp +++ b/common/query.cpp | |||
@@ -62,6 +62,11 @@ bool Query::Comparator::matches(const QVariant &v) const | |||
62 | return false; | 62 | return false; |
63 | } | 63 | } |
64 | return v.value<QByteArrayList>().contains(value.toByteArray()); | 64 | return v.value<QByteArrayList>().contains(value.toByteArray()); |
65 | case In: | ||
66 | if (!v.isValid()) { | ||
67 | return false; | ||
68 | } | ||
69 | return value.value<QByteArrayList>().contains(v.toByteArray()); | ||
65 | case Invalid: | 70 | case Invalid: |
66 | default: | 71 | default: |
67 | break; | 72 | break; |