diff options
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 |