summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/typeindex.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp
index e9a0f79..19e0507 100644
--- a/common/typeindex.cpp
+++ b/common/typeindex.cpp
@@ -20,6 +20,7 @@
20 20
21#include "log.h" 21#include "log.h"
22#include "index.h" 22#include "index.h"
23#include <QDateTime>
23 24
24TypeIndex::TypeIndex(const QByteArray &type) 25TypeIndex::TypeIndex(const QByteArray &type)
25 : mType(type) 26 : mType(type)
@@ -61,9 +62,10 @@ template<>
61void TypeIndex::addProperty<QDateTime>(const QByteArray &property) 62void TypeIndex::addProperty<QDateTime>(const QByteArray &property)
62{ 63{
63 auto indexer = [this, property](const QByteArray &identifier, const QVariant &value, Akonadi2::Storage::Transaction &transaction) { 64 auto indexer = [this, property](const QByteArray &identifier, const QVariant &value, Akonadi2::Storage::Transaction &transaction) {
64 // Trace() << "Indexing " << mType + ".index." + property << value.toByteArray(); 65 const auto date = value.toDateTime();
65 if (value.isValid()) { 66 // Trace() << "Indexing " << mType + ".index." + property << date.toString();
66 Index(mType + ".index." + property, transaction).add(value.toByteArray(), identifier); 67 if (date.isValid()) {
68 Index(mType + ".index." + property, transaction).add(date.toString().toLatin1(), identifier);
67 } 69 }
68 }; 70 };
69 mIndexer.insert(property, indexer); 71 mIndexer.insert(property, indexer);