summaryrefslogtreecommitdiffstats
path: root/common/domain/event.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/domain/event.cpp')
-rw-r--r--common/domain/event.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/domain/event.cpp b/common/domain/event.cpp
index 15f5d11..e107441 100644
--- a/common/domain/event.cpp
+++ b/common/domain/event.cpp
@@ -34,11 +34,11 @@
34 34
35using namespace Akonadi2::ApplicationDomain; 35using namespace Akonadi2::ApplicationDomain;
36 36
37ResultSet TypeImplementation<Event>::queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier, QSet<QByteArray> &appliedFilters) 37ResultSet TypeImplementation<Event>::queryIndexes(const Akonadi2::Query &query, const QByteArray &resourceInstanceIdentifier, QSet<QByteArray> &appliedFilters, Akonadi2::Storage::Transaction &transaction)
38{ 38{
39 QVector<QByteArray> keys; 39 QVector<QByteArray> keys;
40 if (query.propertyFilter.contains("uid")) { 40 if (query.propertyFilter.contains("uid")) {
41 Index uidIndex(Akonadi2::storageLocation(), resourceInstanceIdentifier + ".index.uid", Akonadi2::Storage::ReadOnly); 41 Index uidIndex("index.uid", transaction);
42 uidIndex.lookup(query.propertyFilter.value("uid").toByteArray(), [&](const QByteArray &value) { 42 uidIndex.lookup(query.propertyFilter.value("uid").toByteArray(), [&](const QByteArray &value) {
43 keys << value; 43 keys << value;
44 }, 44 },
@@ -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) 53void TypeImplementation<Event>::index(const Event &type, Akonadi2::Storage::Transaction &transaction)
54{ 54{
55 Index uidIndex(Akonadi2::storageLocation(), type.resourceInstanceIdentifier() + ".index.uid", Akonadi2::Storage::ReadWrite);
56 const auto uid = type.getProperty("uid"); 55 const auto uid = type.getProperty("uid");
57 if (uid.isValid()) { 56 if (uid.isValid()) {
57 Index uidIndex("index.uid", transaction);
58 uidIndex.add(uid.toByteArray(), type.identifier()); 58 uidIndex.add(uid.toByteArray(), type.identifier());
59 } 59 }
60} 60}