summaryrefslogtreecommitdiffstats
path: root/common/index.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-03-30 23:38:45 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-03-31 11:11:08 +0200
commit42f32ea5865c95028c577000e15e8a8631d16e74 (patch)
tree2d9e8a77ccccf088a8807f35f87e4264163d6cdd /common/index.cpp
parent34851314d39307f22df01a4b711e6fd3c5618e23 (diff)
downloadsink-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.cpp4
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)
17void Index::lookup(const QByteArray &key, const std::function<void(const QByteArray &value)> &resultHandler, 17void 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 );