From 2d8f8861eeb1c7b5888a65ab07d51b0419feeb3e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 5 Jun 2016 21:32:21 +0200 Subject: A central place to generate uuid's --- common/storage_common.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common/storage_common.cpp') 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 @@ #include "storage.h" #include "log.h" +#include namespace Sink { @@ -168,6 +169,11 @@ qint64 Storage::revisionFromKey(const QByteArray &key) return key.mid(39).toLongLong(); } +QByteArray Storage::generateUid() +{ + return QUuid::createUuid().toByteArray(); +} + Storage::NamedDatabase Storage::mainDatabase(const Sink::Storage::Transaction &t, const QByteArray &type) { return t.openDatabase(type + ".main"); -- cgit v1.2.3