diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-05 21:32:21 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-05 21:32:21 +0200 |
commit | 2d8f8861eeb1c7b5888a65ab07d51b0419feeb3e (patch) | |
tree | 10ceae2a5c7a85ba02ca2d9b603e2cabea37aba4 /common/storage_common.cpp | |
parent | 4d4028af66144535634ec8c9c4aa229758b57372 (diff) | |
download | sink-2d8f8861eeb1c7b5888a65ab07d51b0419feeb3e.tar.gz sink-2d8f8861eeb1c7b5888a65ab07d51b0419feeb3e.zip |
A central place to generate uuid's
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r-- | common/storage_common.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/storage_common.cpp b/common/storage_common.cpp index 8227a98..9648ea6 100644 --- a/common/storage_common.cpp +++ b/common/storage_common.cpp | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "storage.h" | 22 | #include "storage.h" |
23 | 23 | ||
24 | #include "log.h" | 24 | #include "log.h" |
25 | #include <QUuid> | ||
25 | 26 | ||
26 | namespace Sink { | 27 | namespace Sink { |
27 | 28 | ||
@@ -168,6 +169,11 @@ qint64 Storage::revisionFromKey(const QByteArray &key) | |||
168 | return key.mid(39).toLongLong(); | 169 | return key.mid(39).toLongLong(); |
169 | } | 170 | } |
170 | 171 | ||
172 | QByteArray Storage::generateUid() | ||
173 | { | ||
174 | return QUuid::createUuid().toByteArray(); | ||
175 | } | ||
176 | |||
171 | Storage::NamedDatabase Storage::mainDatabase(const Sink::Storage::Transaction &t, const QByteArray &type) | 177 | Storage::NamedDatabase Storage::mainDatabase(const Sink::Storage::Transaction &t, const QByteArray &type) |
172 | { | 178 | { |
173 | return t.openDatabase(type + ".main"); | 179 | return t.openDatabase(type + ".main"); |