From 49b83e87e4da54cdd18ec04b10fdb4624389bd80 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 19 Jun 2018 11:00:39 +0200 Subject: Fixed the thread index. * Modifications could result in index changes because we lost the threadId due to remove + add. A modify was necessary (although we can ignore it for the email case). * The ThreadIndexer would try to lookup and potentially index threads for empty parent ids, which is clearly wrong. --- common/index.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common/index.cpp') diff --git a/common/index.cpp b/common/index.cpp index 13ca6ed..86a2dd5 100644 --- a/common/index.cpp +++ b/common/index.cpp @@ -2,6 +2,14 @@ #include "log.h" +Index::Index(const QString &storageRoot, const QString &dbName, const QString &indexName, Sink::Storage::DataStore::AccessMode mode) + : mTransaction(Sink::Storage::DataStore(storageRoot, dbName, mode).createTransaction(mode)), + mDb(mTransaction.openDatabase(indexName.toLatin1(), std::function(), true)), + mName(indexName), + mLogCtx("index." + indexName.toLatin1()) +{ +} + Index::Index(const QString &storageRoot, const QString &name, Sink::Storage::DataStore::AccessMode mode) : mTransaction(Sink::Storage::DataStore(storageRoot, name, mode).createTransaction(mode)), mDb(mTransaction.openDatabase(name.toLatin1(), std::function(), true)), -- cgit v1.2.3