diff options
-rw-r--r-- | common/facade.cpp | 7 | ||||
-rw-r--r-- | common/query.h | 1 | ||||
-rw-r--r-- | tests/querytest.cpp | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/common/facade.cpp b/common/facade.cpp index 08f7500..59972bf 100644 --- a/common/facade.cpp +++ b/common/facade.cpp | |||
@@ -350,12 +350,12 @@ template<class DomainType> | |||
350 | qint64 GenericFacade<DomainType>::executeInitialQuery(const Akonadi2::Query &query, const typename DomainType::Ptr &parent, Akonadi2::ResultProviderInterface<typename DomainType::Ptr> &resultProvider) | 350 | qint64 GenericFacade<DomainType>::executeInitialQuery(const Akonadi2::Query &query, const typename DomainType::Ptr &parent, Akonadi2::ResultProviderInterface<typename DomainType::Ptr> &resultProvider) |
351 | { | 351 | { |
352 | auto modifiedQuery = query; | 352 | auto modifiedQuery = query; |
353 | if (parent) { | 353 | if (parent && !query.parentProperty.isEmpty()) { |
354 | Trace() << "Running initial query for parent:" << parent->identifier(); | 354 | Trace() << "Running initial query for parent:" << parent->identifier(); |
355 | modifiedQuery.propertyFilter.insert("parent", parent->identifier()); | 355 | modifiedQuery.propertyFilter.insert(query.parentProperty, parent->identifier()); |
356 | } else { | 356 | } else { |
357 | Trace() << "Running initial query for toplevel"; | 357 | Trace() << "Running initial query for toplevel"; |
358 | modifiedQuery.propertyFilter.insert("parent", QVariant()); | 358 | modifiedQuery.propertyFilter.insert(query.parentProperty, QVariant()); |
359 | } | 359 | } |
360 | return load(modifiedQuery, [&](Akonadi2::Storage::Transaction &transaction, QSet<QByteArray> &remainingFilters) -> ResultSet { | 360 | return load(modifiedQuery, [&](Akonadi2::Storage::Transaction &transaction, QSet<QByteArray> &remainingFilters) -> ResultSet { |
361 | return loadInitialResultSet(modifiedQuery, transaction, remainingFilters); | 361 | return loadInitialResultSet(modifiedQuery, transaction, remainingFilters); |
@@ -365,6 +365,5 @@ qint64 GenericFacade<DomainType>::executeInitialQuery(const Akonadi2::Query &que | |||
365 | template class Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Folder>; | 365 | template class Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Folder>; |
366 | template class Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Mail>; | 366 | template class Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Mail>; |
367 | template class Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Event>; | 367 | template class Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Event>; |
368 | // template class Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::AkonadiResource>; | ||
369 | 368 | ||
370 | #include "facade.moc" | 369 | #include "facade.moc" |
diff --git a/common/query.h b/common/query.h index 0cad9fb..5313fa9 100644 --- a/common/query.h +++ b/common/query.h | |||
@@ -53,6 +53,7 @@ public: | |||
53 | QHash<QByteArray, QVariant> propertyFilter; | 53 | QHash<QByteArray, QVariant> propertyFilter; |
54 | //Properties to retrieve | 54 | //Properties to retrieve |
55 | QSet<QByteArray> requestedProperties; | 55 | QSet<QByteArray> requestedProperties; |
56 | QByteArray parentProperty; | ||
56 | bool syncOnDemand; | 57 | bool syncOnDemand; |
57 | bool processAll; | 58 | bool processAll; |
58 | //If live query is false, this query will not continuously be updated | 59 | //If live query is false, this query will not continuously be updated |
diff --git a/tests/querytest.cpp b/tests/querytest.cpp index 677dbac..fdfb609 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp | |||
@@ -145,6 +145,7 @@ private Q_SLOTS: | |||
145 | query.resources << "org.kde.dummy.instance1"; | 145 | query.resources << "org.kde.dummy.instance1"; |
146 | query.syncOnDemand = false; | 146 | query.syncOnDemand = false; |
147 | query.processAll = true; | 147 | query.processAll = true; |
148 | query.parentProperty = "parent"; | ||
148 | 149 | ||
149 | //Ensure all local data is processed | 150 | //Ensure all local data is processed |
150 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 151 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); |