From 142bf3d8bc6569a432e065e851f026a46e9595ed Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Tue, 27 Jan 2015 18:44:03 +0100 Subject: introduce a set of isInternalKey functions to hide this impl detail --- common/messagequeue.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/messagequeue.cpp') diff --git a/common/messagequeue.cpp b/common/messagequeue.cpp index 3754b16..76f8162 100644 --- a/common/messagequeue.cpp +++ b/common/messagequeue.cpp @@ -1,4 +1,5 @@ #include "messagequeue.h" +#include "storage.h" #include MessageQueue::MessageQueue(const QString &storageRoot, const QString &name) @@ -24,7 +25,7 @@ void MessageQueue::dequeue(const std::function bool { const auto key = QByteArray::fromRawData(static_cast(keyPtr), keySize); - if (key.startsWith("__internal")) { + if (Akonadi2::Storage::isInternalKey(key)) { return true; } readValue = true; @@ -55,7 +56,7 @@ bool MessageQueue::isEmpty() int count = 0; mStorage.scan("", [&count](void *keyPtr, int keySize, void *valuePtr, int valueSize) -> bool { const auto key = QByteArray::fromRawData(static_cast(keyPtr), keySize); - if (!key.startsWith("__internal")) { + if (!Akonadi2::Storage::isInternalKey(key)) { count++; return false; } -- cgit v1.2.3