summaryrefslogtreecommitdiffstats
path: root/common/domain
diff options
context:
space:
mode:
Diffstat (limited to 'common/domain')
-rw-r--r--common/domain/event.cpp6
-rw-r--r--common/domain/event.h2
-rw-r--r--common/domain/mail.cpp7
-rw-r--r--common/domain/mail.h2
4 files changed, 8 insertions, 9 deletions
diff --git a/common/domain/event.cpp b/common/domain/event.cpp
index 9759fc3..83a6906 100644
--- a/common/domain/event.cpp
+++ b/common/domain/event.cpp
@@ -50,11 +50,11 @@ ResultSet TypeImplementation<Event>::queryIndexes(const Akonadi2::Query &query,
50 return ResultSet(keys); 50 return ResultSet(keys);
51} 51}
52 52
53void TypeImplementation<Event>::index(const Event &type, Akonadi2::Storage::Transaction &transaction) 53void TypeImplementation<Event>::index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction)
54{ 54{
55 const auto uid = type.getProperty("uid"); 55 const auto uid = bufferAdaptor.getProperty("uid");
56 if (uid.isValid()) { 56 if (uid.isValid()) {
57 Index("event.index.uid", transaction).add(uid.toByteArray(), type.identifier()); 57 Index("event.index.uid", transaction).add(uid.toByteArray(), identifier);
58 } 58 }
59} 59}
60 60
diff --git a/common/domain/event.h b/common/domain/event.h
index f21cd34..e9ba52a 100644
--- a/common/domain/event.h
+++ b/common/domain/event.h
@@ -56,7 +56,7 @@ public:
56 * An empty result set indicates that a full scan is required. 56 * An empty result set indicates that a full scan is required.
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 Event &type, Akonadi2::Storage::Transaction &transaction); 59 static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction);
60 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper(); 60 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper();
61 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper(); 61 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper();
62}; 62};
diff --git a/common/domain/mail.cpp b/common/domain/mail.cpp
index d40dde9..ffe322e 100644
--- a/common/domain/mail.cpp
+++ b/common/domain/mail.cpp
@@ -50,12 +50,11 @@ ResultSet TypeImplementation<Mail>::queryIndexes(const Akonadi2::Query &query, c
50 return ResultSet(keys); 50 return ResultSet(keys);
51} 51}
52 52
53void TypeImplementation<Mail>::index(const Mail &type, Akonadi2::Storage::Transaction &transaction) 53void TypeImplementation<Mail>::index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction)
54{ 54{
55 const auto uid = type.getProperty("uid"); 55 const auto uid = bufferAdaptor.getProperty("uid");
56 if (uid.isValid()) { 56 if (uid.isValid()) {
57 Index uidIndex("mail.index.uid", transaction); 57 Index("mail.index.uid", transaction).add(uid.toByteArray(), identifier);
58 uidIndex.add(uid.toByteArray(), type.identifier());
59 } 58 }
60} 59}
61 60
diff --git a/common/domain/mail.h b/common/domain/mail.h
index b58ce44..38f1d03 100644
--- a/common/domain/mail.h
+++ b/common/domain/mail.h
@@ -51,7 +51,7 @@ public:
51 * An empty result set indicates that a full scan is required. 51 * An empty result set indicates that a full scan is required.
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 Mail &type, Akonadi2::Storage::Transaction &transaction); 54 static void index(const QByteArray &identifier, const BufferAdaptor &bufferAdaptor, Akonadi2::Storage::Transaction &transaction);
55 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper(); 55 static QSharedPointer<ReadPropertyMapper<Buffer> > initializeReadPropertyMapper();
56 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper(); 56 static QSharedPointer<WritePropertyMapper<BufferBuilder> > initializeWritePropertyMapper();
57}; 57};