summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/domain/event.cpp8
-rw-r--r--common/domain/event.h1
-rw-r--r--common/domain/mail.cpp8
-rw-r--r--common/domain/mail.h1
4 files changed, 18 insertions, 0 deletions
diff --git a/common/domain/event.cpp b/common/domain/event.cpp
index 83a6906..87e13bc 100644
--- a/common/domain/event.cpp
+++ b/common/domain/event.cpp
@@ -58,6 +58,14 @@ void TypeImplementation<Event>::index(const QByteArray &identifier, const Buffer
58 } 58 }
59} 59}
60 60
61void TypeImplementation<Event>::removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction)
62{
63 const auto uid = bufferAdaptor.getProperty("uid");
64 if (uid.isValid()) {
65 Index("event.index.uid", transaction).remove(uid.toByteArray(), identifier);
66 }
67}
68
61QSharedPointer<ReadPropertyMapper<TypeImplementation<Event>::Buffer> > TypeImplementation<Event>::initializeReadPropertyMapper() 69QSharedPointer<ReadPropertyMapper<TypeImplementation<Event>::Buffer> > TypeImplementation<Event>::initializeReadPropertyMapper()
62{ 70{
63 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::create(); 71 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::create();
diff --git a/common/domain/event.h b/common/domain/event.h
index e9ba52a..577367b 100644
--- a/common/domain/event.h
+++ b/common/domain/event.h
@@ -57,6 +57,7 @@ public:
57 */ 57 */
58 static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier, QSet<QByteArray> &appliedFilters, Akonadi2::Storage::Transaction &transaction); 58 static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier, QSet<QByteArray> &appliedFilters, Akonadi2::Storage::Transaction &transaction);
59 static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction); 59 static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction);
60 static void removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction);
60 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper(); 61 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper();
61 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper(); 62 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper();
62}; 63};
diff --git a/common/domain/mail.cpp b/common/domain/mail.cpp
index ffe322e..5373ac6 100644
--- a/common/domain/mail.cpp
+++ b/common/domain/mail.cpp
@@ -58,6 +58,14 @@ void TypeImplementation<Mail>::index(const QByteArray &identifier, const BufferA
58 } 58 }
59} 59}
60 60
61void TypeImplementation<Mail>::removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction)
62{
63 const auto uid = bufferAdaptor.getProperty("uid");
64 if (uid.isValid()) {
65 Index("mail.index.uid", transaction).remove(uid.toByteArray(), identifier);
66 }
67}
68
61QSharedPointer<ReadPropertyMapper<TypeImplementation<Mail>::Buffer> > TypeImplementation<Mail>::initializeReadPropertyMapper() 69QSharedPointer<ReadPropertyMapper<TypeImplementation<Mail>::Buffer> > TypeImplementation<Mail>::initializeReadPropertyMapper()
62{ 70{
63 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::create(); 71 auto propertyMapper = QSharedPointer<ReadPropertyMapper<Buffer> >::create();
diff --git a/common/domain/mail.h b/common/domain/mail.h
index 38f1d03..d1ef8d6 100644
--- a/common/domain/mail.h
+++ b/common/domain/mail.h
@@ -52,6 +52,7 @@ public:
52 */ 52 */
53 static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier, QSet<QByteArray> &appliedFilters, Akonadi2::Storage::Transaction &transaction); 53 static ResultSet queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier, QSet<QByteArray> &appliedFilters, Akonadi2::Storage::Transaction &transaction);
54 static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction); 54 static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction);
55 static void removeIndex(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction);
55 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper(); 56 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper();
56 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper(); 57 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper();
57}; 58};