summaryrefslogtreecommitdiffstats
path: root/common/typeindex.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-20 17:46:10 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-21 09:18:50 +0200
commit0c1f6da51631c0a573a44e2f93eb4012d52dfe5c (patch)
treecf3cd3bec9fabd44a7107f47e7b0b057880ecb61 /common/typeindex.cpp
parent9a03eb1a54c6289773bc1b8eb96181ed01553927 (diff)
downloadsink-0c1f6da51631c0a573a44e2f93eb4012d52dfe5c.tar.gz
sink-0c1f6da51631c0a573a44e2f93eb4012d52dfe5c.zip
Get access to properties in indexes.
Diffstat (limited to 'common/typeindex.cpp')
-rw-r--r--common/typeindex.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp
index 8f5de4f..036b662 100644
--- a/common/typeindex.cpp
+++ b/common/typeindex.cpp
@@ -238,10 +238,10 @@ void TypeIndex::index<QString, QByteArray>(const QByteArray &leftName, const QBy
238} 238}
239 239
240template <> 240template <>
241QVector<QByteArray> TypeIndex::secondaryLookup<QByteArray>(const QByteArray &leftName, const QByteArray &rightName, const QVariant &value, Sink::Storage::DataStore::Transaction &transaction) 241QVector<QByteArray> TypeIndex::secondaryLookup<QByteArray>(const QByteArray &leftName, const QByteArray &rightName, const QVariant &value)
242{ 242{
243 QVector<QByteArray> keys; 243 QVector<QByteArray> keys;
244 Index index(indexName(leftName + rightName), transaction); 244 Index index(indexName(leftName + rightName), *mTransaction);
245 const auto lookupKey = getByteArray(value); 245 const auto lookupKey = getByteArray(value);
246 index.lookup( 246 index.lookup(
247 lookupKey, [&](const QByteArray &value) { keys << value; }, [=](const Index::Error &error) { SinkWarning() << "Error in index: " << error.message << value; }); 247 lookupKey, [&](const QByteArray &value) { keys << value; }, [=](const Index::Error &error) { SinkWarning() << "Error in index: " << error.message << value; });
@@ -250,10 +250,10 @@ QVector<QByteArray> TypeIndex::secondaryLookup<QByteArray>(const QByteArray &lef
250} 250}
251 251
252template <> 252template <>
253QVector<QByteArray> TypeIndex::secondaryLookup<QString>(const QByteArray &leftName, const QByteArray &rightName, const QVariant &value, Sink::Storage::DataStore::Transaction &transaction) 253QVector<QByteArray> TypeIndex::secondaryLookup<QString>(const QByteArray &leftName, const QByteArray &rightName, const QVariant &value)
254{ 254{
255 QVector<QByteArray> keys; 255 QVector<QByteArray> keys;
256 Index index(indexName(leftName + rightName), transaction); 256 Index index(indexName(leftName + rightName), *mTransaction);
257 const auto lookupKey = getByteArray(value); 257 const auto lookupKey = getByteArray(value);
258 index.lookup( 258 index.lookup(
259 lookupKey, [&](const QByteArray &value) { keys << value; }, [=](const Index::Error &error) { SinkWarning() << "Error in index: " << error.message << value; }); 259 lookupKey, [&](const QByteArray &value) { keys << value; }, [=](const Index::Error &error) { SinkWarning() << "Error in index: " << error.message << value; });