summaryrefslogtreecommitdiffstats
path: root/common/domain
diff options
context:
space:
mode:
Diffstat (limited to 'common/domain')
-rw-r--r--common/domain/event.cpp21
-rw-r--r--common/domain/event.h2
-rw-r--r--common/domain/folder.cpp22
-rw-r--r--common/domain/folder.h2
-rw-r--r--common/domain/mail.cpp13
-rw-r--r--common/domain/mail.h2
6 files changed, 0 insertions, 62 deletions
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<Event>::configureIndex(TypeIndex &index)
47 index.addProperty<QByteArray>(Event::Uid::name); 47 index.addProperty<QByteArray>(Event::Uid::name);
48} 48}
49 49
50static TypeIndex &getIndex()
51{
52 QMutexLocker locker(&sMutex);
53 static TypeIndex *index = 0;
54 if (!index) {
55 index = new TypeIndex("event");
56 TypeImplementation<Event>::configureIndex(*index);
57 }
58 return *index;
59}
60
61void TypeImplementation<Event>::index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction)
62{
63 return getIndex().add(identifier, bufferAdaptor, transaction);
64}
65
66void TypeImplementation<Event>::removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction)
67{
68 return getIndex().remove(identifier, bufferAdaptor, transaction);
69}
70
71QSharedPointer<ReadPropertyMapper<TypeImplementation<Event>::Buffer> > TypeImplementation<Event>::initializeReadPropertyMapper() 50QSharedPointer<ReadPropertyMapper<TypeImplementation<Event>::Buffer> > TypeImplementation<Event>::initializeReadPropertyMapper()
72{ 51{
73 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::create(); 52 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::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:
56 typedef Sink::ApplicationDomain::Buffer::EventBuilder BufferBuilder; 56 typedef Sink::ApplicationDomain::Buffer::EventBuilder BufferBuilder;
57 static void configureIndex(TypeIndex &index); 57 static void configureIndex(TypeIndex &index);
58 static QSet<QByteArray> indexedProperties(); 58 static QSet<QByteArray> indexedProperties();
59 static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction);
60 static void removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction);
61 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper(); 59 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper();
62 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper(); 60 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper();
63}; 61};
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<Folder>::configureIndex(TypeIndex &index)
50 index.addProperty<QString>(Folder::Name::name); 50 index.addProperty<QString>(Folder::Name::name);
51} 51}
52 52
53static TypeIndex &getIndex()
54{
55 QMutexLocker locker(&sMutex);
56 static TypeIndex *index = 0;
57 if (!index) {
58 index = new TypeIndex("folder");
59 TypeImplementation<Folder>::configureIndex(*index);
60 }
61 return *index;
62}
63
64void TypeImplementation<Folder>::index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction)
65{
66 SinkTrace() << "Indexing " << identifier;
67 getIndex().add(identifier, bufferAdaptor, transaction);
68}
69
70void TypeImplementation<Folder>::removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction)
71{
72 getIndex().remove(identifier, bufferAdaptor, transaction);
73}
74
75QSharedPointer<ReadPropertyMapper<TypeImplementation<Folder>::Buffer> > TypeImplementation<Folder>::initializeReadPropertyMapper() 53QSharedPointer<ReadPropertyMapper<TypeImplementation<Folder>::Buffer> > TypeImplementation<Folder>::initializeReadPropertyMapper()
76{ 54{
77 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::create(); 55 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::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:
50 typedef Sink::ApplicationDomain::Buffer::FolderBuilder BufferBuilder; 50 typedef Sink::ApplicationDomain::Buffer::FolderBuilder BufferBuilder;
51 static void configureIndex(TypeIndex &index); 51 static void configureIndex(TypeIndex &index);
52 static QSet<QByteArray> indexedProperties(); 52 static QSet<QByteArray> indexedProperties();
53 static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction);
54 static void removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction);
55 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper(); 53 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper();
56 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper(); 54 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper();
57}; 55};
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
170 } 170 }
171} 171}
172 172
173void TypeImplementation<Mail>::index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction)
174{
175 SinkTrace() << "Indexing " << identifier;
176 getIndex().add(identifier, bufferAdaptor, transaction);
177 updateThreadingIndex(identifier, bufferAdaptor, transaction);
178}
179
180void TypeImplementation<Mail>::removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction)
181{
182 getIndex().remove(identifier, bufferAdaptor, transaction);
183 //TODO cleanup threading index
184}
185
186QSharedPointer<ReadPropertyMapper<TypeImplementation<Mail>::Buffer> > TypeImplementation<Mail>::initializeReadPropertyMapper() 173QSharedPointer<ReadPropertyMapper<TypeImplementation<Mail>::Buffer> > TypeImplementation<Mail>::initializeReadPropertyMapper()
187{ 174{
188 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::create(); 175 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::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:
50 typedef Sink::ApplicationDomain::Buffer::MailBuilder BufferBuilder; 50 typedef Sink::ApplicationDomain::Buffer::MailBuilder BufferBuilder;
51 static void configureIndex(TypeIndex &index); 51 static void configureIndex(TypeIndex &index);
52 static QSet<QByteArray> indexedProperties(); 52 static QSet<QByteArray> indexedProperties();
53 static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction);
54 static void removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Sink::Storage::DataStore::Transaction &transaction);
55 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper(); 53 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper();
56 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper(); 54 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper();
57}; 55};