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 --- dummyresource/facade.cpp | 2 +- dummyresource/resourcefactory.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'dummyresource') diff --git a/dummyresource/facade.cpp b/dummyresource/facade.cpp index 79763ef..e0d27dc 100644 --- a/dummyresource/facade.cpp +++ b/dummyresource/facade.cpp @@ -138,7 +138,7 @@ void DummyResourceFacade::readValue(QSharedPointer storage, c storage->scan(key.data(), key.size(), [=](void *keyValue, int keySize, void *dataValue, int dataSize) -> bool { //Skip internals - if (QByteArray::fromRawData(static_cast(keyValue), keySize).startsWith("__internal")) { + if (Akonadi2::Storage::isInternalKey(keyValue, keySize)) { return true; } diff --git a/dummyresource/resourcefactory.cpp b/dummyresource/resourcefactory.cpp index aefd66f..e5019f2 100644 --- a/dummyresource/resourcefactory.cpp +++ b/dummyresource/resourcefactory.cpp @@ -113,9 +113,8 @@ public: mProcessingLock(false) { for (auto queue : mCommandQueues) { - bool ret = connect(queue, &MessageQueue::messageReady, this, &Processor::process); + const bool ret = connect(queue, &MessageQueue::messageReady, this, &Processor::process); Q_UNUSED(ret); - Q_ASSERT(ret); } } @@ -298,7 +297,7 @@ void findByRemoteId(QSharedPointer storage, const QString &ri //TODO lookup in rid index instead of doing a full scan const std::string ridString = rid.toStdString(); storage->scan("", [&](void *keyValue, int keySize, void *dataValue, int dataSize) -> bool { - if (QByteArray::fromRawData(static_cast(keyValue), keySize).startsWith("__internal")) { + if (Akonadi2::Storage::isInternalKey(keyValue, keySize)) { return true; } -- cgit v1.2.3