summaryrefslogtreecommitdiffstats
path: root/common/storage_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r--common/storage_common.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/storage_common.cpp b/common/storage_common.cpp
index 09b7707..7c794c3 100644
--- a/common/storage_common.cpp
+++ b/common/storage_common.cpp
@@ -233,6 +233,18 @@ void DataStore::getUids(const QByteArray &type, const Transaction &transaction,
233 }); 233 });
234} 234}
235 235
236bool DataStore::hasUid(const QByteArray &type, const Transaction &transaction, const QByteArray &uid)
237{
238 bool hasTheUid = false;
239 transaction.openDatabase(type + "uids").scan(uid, [&](const QByteArray &key, const QByteArray &) {
240 Q_ASSERT(uid == key);
241 hasTheUid = true;
242 return false;
243 });
244
245 return hasTheUid;
246}
247
236bool DataStore::isInternalKey(const char *key) 248bool DataStore::isInternalKey(const char *key)
237{ 249{
238 return key && strncmp(key, s_internalPrefix, s_internalPrefixSize) == 0; 250 return key && strncmp(key, s_internalPrefix, s_internalPrefixSize) == 0;