diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2014-12-21 22:20:31 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2014-12-21 22:20:31 +0100 |
commit | d80ff84c28c0be626c1df4528741cddf5a55f547 (patch) | |
tree | dfa1a3771f52970bfaf7b9e56d8675aeabfc65ef /common/storage_common.cpp | |
parent | d21aa4e35fb96fa3b07888f710cbc3440af8bdd3 (diff) | |
download | sink-d80ff84c28c0be626c1df4528741cddf5a55f547.tar.gz sink-d80ff84c28c0be626c1df4528741cddf5a55f547.zip |
Write-Read loop from clientside.
It's a huge hack but starts to show results.
Most urgently we need:
* reliable command results
* the 3 buffers instead of the 1
* A way to implement storage as preprocessor (or a place to impelement it after the preprocessors).
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r-- | common/storage_common.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/common/storage_common.cpp b/common/storage_common.cpp index 8f465fc..bdae9dd 100644 --- a/common/storage_common.cpp +++ b/common/storage_common.cpp | |||
@@ -52,4 +52,23 @@ void Storage::scan(const std::string &sKey, const std::function<bool(void *keyPt | |||
52 | scan(sKey.data(), sKey.size(), resultHandler, &errorHandler); | 52 | scan(sKey.data(), sKey.size(), resultHandler, &errorHandler); |
53 | } | 53 | } |
54 | 54 | ||
55 | void Storage::setMaxRevision(qint64 revision) | ||
56 | { | ||
57 | write("__internal_maxRevision", QString::number(revision).toStdString()); | ||
58 | } | ||
59 | |||
60 | qint64 Storage::maxRevision() | ||
61 | { | ||
62 | qint64 r = 0; | ||
63 | read(std::string("__internal_maxRevision"), [&](const std::string &revision) -> bool { | ||
64 | r = QString::fromStdString(revision).toLongLong(); | ||
65 | return false; | ||
66 | }, | ||
67 | [](const Storage::Error &error) { | ||
68 | //Ignore the error in case we don't find the value | ||
69 | //TODO only ignore value not found errors | ||
70 | }); | ||
71 | return r; | ||
72 | } | ||
73 | |||
55 | } // namespace Akonadi2 | 74 | } // namespace Akonadi2 |