diff options
Diffstat (limited to 'common/pipeline.cpp')
-rw-r--r-- | common/pipeline.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/pipeline.cpp b/common/pipeline.cpp index 0ce478b..16d8329 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp | |||
@@ -150,7 +150,14 @@ KAsync::Job<qint64> Pipeline::newEntity(void const *command, size_t size) | |||
150 | return KAsync::error<qint64>(0); | 150 | return KAsync::error<qint64>(0); |
151 | } | 151 | } |
152 | 152 | ||
153 | const auto key = QUuid::createUuid().toString().toUtf8(); | 153 | QByteArray key; |
154 | if (createEntity->entityId()) { | ||
155 | key = QByteArray(reinterpret_cast<char const*>(createEntity->entityId()->Data()), createEntity->entityId()->size()); | ||
156 | } | ||
157 | if (key.isEmpty()) { | ||
158 | key = QUuid::createUuid().toString().toUtf8(); | ||
159 | } | ||
160 | Q_ASSERT(!key.isEmpty()); | ||
154 | const qint64 newRevision = Akonadi2::Storage::maxRevision(d->transaction) + 1; | 161 | const qint64 newRevision = Akonadi2::Storage::maxRevision(d->transaction) + 1; |
155 | 162 | ||
156 | //Add metadata buffer | 163 | //Add metadata buffer |