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 2c23f97..1dbc178 100644 --- a/common/storage_common.cpp +++ b/common/storage_common.cpp | |||
@@ -73,6 +73,25 @@ qint64 Storage::maxRevision(const Akonadi2::Storage::Transaction &transaction) | |||
73 | return r; | 73 | return r; |
74 | } | 74 | } |
75 | 75 | ||
76 | void Storage::setCleanedUpRevision(Akonadi2::Storage::Transaction &transaction, qint64 revision) | ||
77 | { | ||
78 | transaction.openDatabase().write("__internal_cleanedUpRevision", QByteArray::number(revision)); | ||
79 | } | ||
80 | |||
81 | qint64 Storage::cleanedUpRevision(const Akonadi2::Storage::Transaction &transaction) | ||
82 | { | ||
83 | qint64 r = 0; | ||
84 | transaction.openDatabase().scan("__internal_cleanedUpRevision", [&](const QByteArray &, const QByteArray &revision) -> bool { | ||
85 | r = revision.toLongLong(); | ||
86 | return false; | ||
87 | }, [](const Error &error){ | ||
88 | if (error.code != Akonadi2::Storage::NotFound) { | ||
89 | std::cout << "Coultn'd find the maximum revision" << std::endl; | ||
90 | } | ||
91 | }); | ||
92 | return r; | ||
93 | } | ||
94 | |||
76 | QByteArray Storage::getUidFromRevision(const Akonadi2::Storage::Transaction &transaction, qint64 revision) | 95 | QByteArray Storage::getUidFromRevision(const Akonadi2::Storage::Transaction &transaction, qint64 revision) |
77 | { | 96 | { |
78 | QByteArray uid; | 97 | QByteArray uid; |