diff options
Diffstat (limited to 'common/index.cpp')
-rw-r--r-- | common/index.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/common/index.cpp b/common/index.cpp index 151f7af..beed45c 100644 --- a/common/index.cpp +++ b/common/index.cpp | |||
@@ -2,8 +2,7 @@ | |||
2 | 2 | ||
3 | #include "log.h" | 3 | #include "log.h" |
4 | 4 | ||
5 | #undef Trace | 5 | SINK_DEBUG_AREA("index") |
6 | #define Trace() Trace_area("index." + mName.toLatin1()) | ||
7 | 6 | ||
8 | Index::Index(const QString &storageRoot, const QString &name, Sink::Storage::AccessMode mode) | 7 | Index::Index(const QString &storageRoot, const QString &name, Sink::Storage::AccessMode mode) |
9 | : mTransaction(Sink::Storage(storageRoot, name, mode).createTransaction(mode)), | 8 | : mTransaction(Sink::Storage(storageRoot, name, mode).createTransaction(mode)), |
@@ -34,8 +33,8 @@ void Index::lookup(const QByteArray &key, const std::function<void(const QByteAr | |||
34 | resultHandler(value); | 33 | resultHandler(value); |
35 | return true; | 34 | return true; |
36 | }, | 35 | }, |
37 | [errorHandler](const Sink::Storage::Error &error) { | 36 | [this, errorHandler](const Sink::Storage::Error &error) { |
38 | Warning() << "Error while retrieving value" << error.message; | 37 | SinkWarning() << "Error while retrieving value" << error.message; |
39 | errorHandler(Error(error.store, error.code, error.message)); | 38 | errorHandler(Error(error.store, error.code, error.message)); |
40 | }, | 39 | }, |
41 | matchSubStringKeys); | 40 | matchSubStringKeys); |
@@ -45,6 +44,6 @@ QByteArray Index::lookup(const QByteArray &key) | |||
45 | { | 44 | { |
46 | QByteArray result; | 45 | QByteArray result; |
47 | //We have to create a deep copy, otherwise the returned data may become invalid when the transaction ends. | 46 | //We have to create a deep copy, otherwise the returned data may become invalid when the transaction ends. |
48 | lookup(key, [&result](const QByteArray &value) { result = QByteArray(value.constData(), value.size()); }, [this](const Index::Error &error) { Trace() << "Error while retrieving value" << error.message; }); | 47 | lookup(key, [&result](const QByteArray &value) { result = QByteArray(value.constData(), value.size()); }, [this](const Index::Error &error) { SinkTrace() << "Error while retrieving value" << error.message; }); |
49 | return result; | 48 | return result; |
50 | } | 49 | } |