diff options
Diffstat (limited to 'common/index.cpp')
-rw-r--r-- | common/index.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/index.cpp b/common/index.cpp index 2fc0fe3..f4de93c 100644 --- a/common/index.cpp +++ b/common/index.cpp | |||
@@ -38,3 +38,16 @@ void Index::lookup(const QByteArray &key, const std::function<void(const QByteAr | |||
38 | ); | 38 | ); |
39 | } | 39 | } |
40 | 40 | ||
41 | QByteArray Index::lookup(const QByteArray &key) | ||
42 | { | ||
43 | QByteArray result; | ||
44 | lookup(key, | ||
45 | [&result](const QByteArray &value) { | ||
46 | result = value; | ||
47 | }, | ||
48 | [](const Index::Error &error) { | ||
49 | qDebug() << "Error while retrieving value" << error.message; | ||
50 | }); | ||
51 | return result; | ||
52 | } | ||
53 | |||