diff options
author | Minijackson <minijackson@riseup.net> | 2018-08-22 11:19:18 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2018-08-22 11:19:18 +0200 |
commit | 2a8abb5970f0f444e36bbd94cd527522c7246def (patch) | |
tree | ef175c60235324146cbf4111d8fb9999c0901fdc /common/storage_common.cpp | |
parent | 3559ec6e6e698f20e600dfbbdff0d56d66576c0d (diff) | |
download | sink-2a8abb5970f0f444e36bbd94cd527522c7246def.tar.gz sink-2a8abb5970f0f444e36bbd94cd527522c7246def.zip |
Fix readRevisions function, fixes pipelinetest
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r-- | common/storage_common.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/storage_common.cpp b/common/storage_common.cpp index ae8e971..09b7707 100644 --- a/common/storage_common.cpp +++ b/common/storage_common.cpp | |||
@@ -162,6 +162,18 @@ QList<size_t> DataStore::getRevisionsUntilFromUid(DataStore::Transaction &t, con | |||
162 | return queriedRevisions; | 162 | return queriedRevisions; |
163 | } | 163 | } |
164 | 164 | ||
165 | QList<size_t> DataStore::getRevisionsFromUid(DataStore::Transaction &t, const QByteArray &uid) | ||
166 | { | ||
167 | QList<size_t> queriedRevisions; | ||
168 | t.openDatabase("uidsToRevisions", {}, AllowDuplicates | IntegerValues) | ||
169 | .scan(uid, [&queriedRevisions](const QByteArray &, const QByteArray &value) { | ||
170 | queriedRevisions << byteArrayToSizeT(value); | ||
171 | return true; | ||
172 | }); | ||
173 | |||
174 | return queriedRevisions; | ||
175 | } | ||
176 | |||
165 | QByteArray DataStore::getTypeFromRevision(const DataStore::Transaction &transaction, size_t revision) | 177 | QByteArray DataStore::getTypeFromRevision(const DataStore::Transaction &transaction, size_t revision) |
166 | { | 178 | { |
167 | QByteArray type; | 179 | QByteArray type; |