From ba7c8b890c45d735216888204ec88882ef58c918 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 19 Oct 2016 15:28:42 +0200 Subject: Ported the pipeline to the entitystore --- common/domain/event.cpp | 21 --------------------- common/domain/event.h | 2 -- common/domain/folder.cpp | 22 ---------------------- common/domain/folder.h | 2 -- common/domain/mail.cpp | 13 ------------- common/domain/mail.h | 2 -- 6 files changed, 62 deletions(-) (limited to 'common/domain') diff --git a/common/domain/event.cpp b/common/domain/event.cpp index d50652d..41ec625 100644 --- a/common/domain/event.cpp +++ b/common/domain/event.cpp @@ -47,27 +47,6 @@ void TypeImplementation::configureIndex(TypeIndex &index) index.addProperty(Event::Uid::name); } -static TypeIndex &getIndex() -{ - QMutexLocker locker(&sMutex); - static TypeIndex *index = 0; - if (!index) { - index = new TypeIndex("event"); - TypeImplementation::configureIndex(*index); - } - return *index; -} - -void TypeImplementation::index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction) -{ - return getIndex().add(identifier, bufferAdaptor, transaction); -} - -void TypeImplementation::removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction) -{ - return getIndex().remove(identifier, bufferAdaptor, transaction); -} - QSharedPointer::Buffer> > TypeImplementation::initializeReadPropertyMapper() { auto propertyMapper = QSharedPointer >::create(); diff --git a/common/domain/event.h b/common/domain/event.h index 18e0f20..fbaf4ed 100644 --- a/common/domain/event.h +++ b/common/domain/event.h @@ -56,8 +56,6 @@ public: typedef Sink::ApplicationDomain::Buffer::EventBuilder BufferBuilder; static void configureIndex(TypeIndex &index); static QSet indexedProperties(); - static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction); - static void removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction); static QSharedPointer > initializeReadPropertyMapper(); static QSharedPointer > initializeWritePropertyMapper(); }; diff --git a/common/domain/folder.cpp b/common/domain/folder.cpp index 94727a3..058035a 100644 --- a/common/domain/folder.cpp +++ b/common/domain/folder.cpp @@ -50,28 +50,6 @@ void TypeImplementation::configureIndex(TypeIndex &index) index.addProperty(Folder::Name::name); } -static TypeIndex &getIndex() -{ - QMutexLocker locker(&sMutex); - static TypeIndex *index = 0; - if (!index) { - index = new TypeIndex("folder"); - TypeImplementation::configureIndex(*index); - } - return *index; -} - -void TypeImplementation::index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction) -{ - SinkTrace() << "Indexing " << identifier; - getIndex().add(identifier, bufferAdaptor, transaction); -} - -void TypeImplementation::removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction) -{ - getIndex().remove(identifier, bufferAdaptor, transaction); -} - QSharedPointer::Buffer> > TypeImplementation::initializeReadPropertyMapper() { auto propertyMapper = QSharedPointer >::create(); diff --git a/common/domain/folder.h b/common/domain/folder.h index ea0d79a..47a544b 100644 --- a/common/domain/folder.h +++ b/common/domain/folder.h @@ -50,8 +50,6 @@ public: typedef Sink::ApplicationDomain::Buffer::FolderBuilder BufferBuilder; static void configureIndex(TypeIndex &index); static QSet indexedProperties(); - static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction); - static void removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction); static QSharedPointer > initializeReadPropertyMapper(); static QSharedPointer > initializeWritePropertyMapper(); }; diff --git a/common/domain/mail.cpp b/common/domain/mail.cpp index b0a3aae..9d58767 100644 --- a/common/domain/mail.cpp +++ b/common/domain/mail.cpp @@ -170,19 +170,6 @@ static void updateThreadingIndex(const QByteArray &identifier, const BufferAdapt } } -void TypeImplementation::index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction) -{ - SinkTrace() << "Indexing " << identifier; - getIndex().add(identifier, bufferAdaptor, transaction); - updateThreadingIndex(identifier, bufferAdaptor, transaction); -} - -void TypeImplementation::removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction) -{ - getIndex().remove(identifier, bufferAdaptor, transaction); - //TODO cleanup threading index -} - QSharedPointer::Buffer> > TypeImplementation::initializeReadPropertyMapper() { auto propertyMapper = QSharedPointer >::create(); diff --git a/common/domain/mail.h b/common/domain/mail.h index 81a0d1c..c0cfc55 100644 --- a/common/domain/mail.h +++ b/common/domain/mail.h @@ -50,8 +50,6 @@ public: typedef Sink::ApplicationDomain::Buffer::MailBuilder BufferBuilder; static void configureIndex(TypeIndex &index); static QSet indexedProperties(); - static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction); - static void removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction); static QSharedPointer > initializeReadPropertyMapper(); static QSharedPointer > initializeWritePropertyMapper(); }; -- cgit v1.2.3