summaryrefslogtreecommitdiffstats
path: root/common/typeindex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/typeindex.cpp')
-rw-r--r--common/typeindex.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp
index 077bfa1..a65c676 100644
--- a/common/typeindex.cpp
+++ b/common/typeindex.cpp
@@ -103,6 +103,12 @@ void TypeIndex::addProperty<QDateTime>(const QByteArray &property)
103} 103}
104 104
105template <> 105template <>
106void TypeIndex::addProperty<ApplicationDomain::Reference>(const QByteArray &property)
107{
108 addProperty<QByteArray>(property);
109}
110
111template <>
106void TypeIndex::addPropertyWithSorting<QByteArray, QDateTime>(const QByteArray &property, const QByteArray &sortProperty) 112void TypeIndex::addPropertyWithSorting<QByteArray, QDateTime>(const QByteArray &property, const QByteArray &sortProperty)
107{ 113{
108 auto indexer = [=](const QByteArray &identifier, const QVariant &value, const QVariant &sortValue, Sink::Storage::DataStore::Transaction &transaction) { 114 auto indexer = [=](const QByteArray &identifier, const QVariant &value, const QVariant &sortValue, Sink::Storage::DataStore::Transaction &transaction) {
@@ -114,8 +120,15 @@ void TypeIndex::addPropertyWithSorting<QByteArray, QDateTime>(const QByteArray &
114 mSortedProperties.insert(property, sortProperty); 120 mSortedProperties.insert(property, sortProperty);
115} 121}
116 122
123template <>
124void TypeIndex::addPropertyWithSorting<ApplicationDomain::Reference, QDateTime>(const QByteArray &property, const QByteArray &sortProperty)
125{
126 addPropertyWithSorting<QByteArray, QDateTime>(property, sortProperty);
127}
128
117void TypeIndex::add(const QByteArray &identifier, const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Storage::DataStore::Transaction &transaction) 129void TypeIndex::add(const QByteArray &identifier, const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Storage::DataStore::Transaction &transaction)
118{ 130{
131 SinkTrace() << "add " << identifier;
119 for (const auto &property : mProperties) { 132 for (const auto &property : mProperties) {
120 const auto value = entity.getProperty(property); 133 const auto value = entity.getProperty(property);
121 auto indexer = mIndexer.value(property); 134 auto indexer = mIndexer.value(property);