diff options
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r-- | common/storage_common.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/common/storage_common.cpp b/common/storage_common.cpp index c922d9d..f96097a 100644 --- a/common/storage_common.cpp +++ b/common/storage_common.cpp | |||
@@ -24,8 +24,6 @@ | |||
24 | #include "log.h" | 24 | #include "log.h" |
25 | #include "utils.h" | 25 | #include "utils.h" |
26 | 26 | ||
27 | #include <QUuid> | ||
28 | |||
29 | QDebug& operator<<(QDebug &dbg, const Sink::Storage::DataStore::Error &error) | 27 | QDebug& operator<<(QDebug &dbg, const Sink::Storage::DataStore::Error &error) |
30 | { | 28 | { |
31 | dbg << error.message << "Code: " << error.code << "Db: " << error.store; | 29 | dbg << error.message << "Code: " << error.code << "Db: " << error.store; |
@@ -38,8 +36,6 @@ namespace Storage { | |||
38 | static const char *s_internalPrefix = "__internal"; | 36 | static const char *s_internalPrefix = "__internal"; |
39 | static const int s_internalPrefixSize = strlen(s_internalPrefix); | 37 | static const int s_internalPrefixSize = strlen(s_internalPrefix); |
40 | static const int s_lengthOfUid = 38; | 38 | static const int s_lengthOfUid = 38; |
41 | // RFC 4122 Section 4.1.2 says 128 bits -> 16 bytes | ||
42 | //static const int s_lengthOfUid = 16; | ||
43 | 39 | ||
44 | DbLayout::DbLayout() | 40 | DbLayout::DbLayout() |
45 | { | 41 | { |
@@ -198,26 +194,6 @@ bool DataStore::isInternalKey(const QByteArray &key) | |||
198 | return key.startsWith(s_internalPrefix); | 194 | return key.startsWith(s_internalPrefix); |
199 | } | 195 | } |
200 | 196 | ||
201 | /* | ||
202 | QByteArray DataStore::assembleKey(const QByteArray &key, qint64 revision) | ||
203 | { | ||
204 | Q_ASSERT(revision <= 9223372036854775807); | ||
205 | Q_ASSERT(key.size() == s_lengthOfUid); | ||
206 | return key + QByteArray::number(revision).rightJustified(19, '0', false); | ||
207 | } | ||
208 | |||
209 | //QByteArray DataStore::uidFromKey(const QByteArray &key) | ||
210 | Identifier DataStore::uidFromKey(const QByteArray &key) | ||
211 | { | ||
212 | return Identifier::fromByteArray(key.mid(0, s_lengthOfUid)); | ||
213 | } | ||
214 | |||
215 | qint64 DataStore::revisionFromKey(const QByteArray &key) | ||
216 | { | ||
217 | return key.mid(s_lengthOfUid + 1).toLongLong(); | ||
218 | } | ||
219 | */ | ||
220 | |||
221 | QByteArray DataStore::generateUid() | 197 | QByteArray DataStore::generateUid() |
222 | { | 198 | { |
223 | return createUuid(); | 199 | return createUuid(); |