From 810543a625074fb8685c7c59e36123c055e8fda6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 7 Jun 2015 19:26:21 +0200 Subject: Use type-specific index implementations. --- common/domain/event.cpp | 3 ++- common/domain/event.h | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/domain/event.cpp b/common/domain/event.cpp index 776fa50..c435c6b 100644 --- a/common/domain/event.cpp +++ b/common/domain/event.cpp @@ -32,7 +32,7 @@ using namespace Akonadi2::ApplicationDomain; -ResultSet TypeImplementation::queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier) +ResultSet TypeImplementation::queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier, QSet &appliedFilters) { QVector keys; if (query.propertyFilter.contains("uid")) { @@ -43,6 +43,7 @@ ResultSet TypeImplementation::queryIndexes(const Akonadi2::Query &query, [](const Index::Error &error) { Warning() << "Error in index: " << error.message; }); + appliedFilters << "uid"; } return ResultSet(keys); } diff --git a/common/domain/event.h b/common/domain/event.h index d40e55d..68c684a 100644 --- a/common/domain/event.h +++ b/common/domain/event.h @@ -39,18 +39,21 @@ namespace ApplicationDomain { /** * Implements all type-specific code such as updating and querying indexes. + * + * These are type specifiy default implementations. Theoretically a resource could implement it's own implementation. */ template<> class TypeImplementation { public: typedef Akonadi2::ApplicationDomain::Buffer::Event Buffer; typedef Akonadi2::ApplicationDomain::Buffer::EventBuilder BufferBuilder; + static QSet indexedProperties(); /** * Returns the potential result set based on the indexes. * * An empty result set indicates that a full scan is required. */ - static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier); + static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier, QSet &appliedFilters); static void index(const Event &type); static QSharedPointer > initializeReadPropertyMapper(); static QSharedPointer > initializeWritePropertyMapper(); -- cgit v1.2.3