diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-03-30 23:38:45 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-03-31 11:11:08 +0200 |
commit | 42f32ea5865c95028c577000e15e8a8631d16e74 (patch) | |
tree | 2d9e8a77ccccf088a8807f35f87e4264163d6cdd /common/index.cpp | |
parent | 34851314d39307f22df01a4b711e6fd3c5618e23 (diff) | |
download | sink-42f32ea5865c95028c577000e15e8a8631d16e74.tar.gz sink-42f32ea5865c95028c577000e15e8a8631d16e74.zip |
Storage: API cleanup/use QByteArray instead of std::string
Diffstat (limited to 'common/index.cpp')
-rw-r--r-- | common/index.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/index.cpp b/common/index.cpp index 7b0c682..9bb467b 100644 --- a/common/index.cpp +++ b/common/index.cpp | |||
@@ -17,12 +17,12 @@ void Index::add(const QByteArray &key, const QByteArray &value) | |||
17 | void Index::lookup(const QByteArray &key, const std::function<void(const QByteArray &value)> &resultHandler, | 17 | void Index::lookup(const QByteArray &key, const std::function<void(const QByteArray &value)> &resultHandler, |
18 | const std::function<void(const Error &error)> &errorHandler) | 18 | const std::function<void(const Error &error)> &errorHandler) |
19 | { | 19 | { |
20 | mStorage.scan(key.data(), key.size(), [this, resultHandler](void *keyPtr, int keySize, void *valuePtr, int valueSize) -> bool { | 20 | mStorage.scan(key, [this, resultHandler](void *keyPtr, int keySize, void *valuePtr, int valueSize) -> bool { |
21 | resultHandler(QByteArray(static_cast<char*>(valuePtr), valueSize)); | 21 | resultHandler(QByteArray(static_cast<char*>(valuePtr), valueSize)); |
22 | return true; | 22 | return true; |
23 | }, | 23 | }, |
24 | [errorHandler](const Akonadi2::Storage::Error &error) { | 24 | [errorHandler](const Akonadi2::Storage::Error &error) { |
25 | qDebug() << "Error while retrieving value" << QString::fromStdString(error.message); | 25 | qDebug() << "Error while retrieving value" << error.message; |
26 | errorHandler(Error(error.store, error.code, error.message)); | 26 | errorHandler(Error(error.store, error.code, error.message)); |
27 | } | 27 | } |
28 | ); | 28 | ); |