diff --git a/common/storage/entitystore.h b/common/storage/entitystore.h --- a/common/storage/entitystore.h +++ b/common/storage/entitystore.h @@ -126,7 +126,7 @@ ///Db contains entity and entity is not yet removed bool exists(const QByteArray &type, const QByteArray &uid); - void readRevisions(const QByteArray &type, const QByteArray &uid, qint64 baseRevision, const std::function callback); + void readRevisions(const QByteArray &type, const QByteArray &uid, size_t baseRevision, const std::function callback); qint64 maxRevision(); diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp --- a/common/storage/entitystore.cpp +++ b/common/storage/entitystore.cpp @@ -318,8 +318,6 @@ flatbuffers::FlatBufferBuilder fbb; d->resourceContext.adaptorFactory(type).createBuffer(newEntity, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); - const auto key = Key(identifier, newRevision); - DataStore::mainDatabase(d->transaction, type) .write(newRevision, BufferUtils::extractBuffer(fbb), [&](const DataStore::Error &error) { SinkWarningCtx(d->logCtx) << "Failed to write entity" << newEntity.identifier() << newRevision; }); @@ -356,8 +354,6 @@ flatbuffers::FlatBufferBuilder fbb; EntityBuffer::assembleEntityBuffer(fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize(), 0, 0, 0, 0); - const auto key = Key(identifier, newRevision); - DataStore::mainDatabase(d->transaction, type) .write(newRevision, BufferUtils::extractBuffer(fbb), [&](const DataStore::Error &error) { SinkWarningCtx(d->logCtx) << "Failed to write entity" << uid << newRevision; }); @@ -397,7 +393,6 @@ } const auto metadata = flatbuffers::GetRoot(buffer.metadataBuffer()); - const qint64 rev = metadata->revision(); if (metadata->operation() == Operation_Removal) { DataStore::removeRevision(d->transaction, revision); DataStore::mainDatabase(d->transaction, bufferType).remove(revision); @@ -666,7 +661,7 @@ return true; } -void EntityStore::readRevisions(const QByteArray &type, const QByteArray &uid, qint64 startingRevision, +void EntityStore::readRevisions(const QByteArray &type, const QByteArray &uid, size_t startingRevision, const std::function callback) { Q_ASSERT(d); diff --git a/examples/caldavresource/caldavresource.cpp b/examples/caldavresource/caldavresource.cpp --- a/examples/caldavresource/caldavresource.cpp +++ b/examples/caldavresource/caldavresource.cpp @@ -166,6 +166,7 @@ // pretty much arbitrary, whoe does that anyway? return modifyItem(remoteItem).then([oldRemoteId] { return oldRemoteId; }); } + return KAsync::null(); } KAsync::Job replay(const Event &event, Sink::Operation operation, diff --git a/examples/carddavresource/carddavresource.cpp b/examples/carddavresource/carddavresource.cpp --- a/examples/carddavresource/carddavresource.cpp +++ b/examples/carddavresource/carddavresource.cpp @@ -130,6 +130,7 @@ return modifyItem(remoteItem).then([=] { return oldRemoteId; }); } + return KAsync::null(); } KAsync::Job replay(const ApplicationDomain::Addressbook &addressbook, Sink::Operation operation, const QByteArray &oldRemoteId, const QList &changedProperties) Q_DECL_OVERRIDE diff --git a/sinksh/syntax_modules/sink_livequery.cpp b/sinksh/syntax_modules/sink_livequery.cpp --- a/sinksh/syntax_modules/sink_livequery.cpp +++ b/sinksh/syntax_modules/sink_livequery.cpp @@ -51,8 +51,6 @@ auto type = options.positionalArguments.isEmpty() ? QString{} : options.positionalArguments.first(); - bool asLine = true; - Sink::Query query; query.setId("livequery"); query.setFlags(Sink::Query::LiveQuery); @@ -85,8 +83,6 @@ } else { query.requestedProperties = SinkshUtils::requestedProperties(type); } - } else { - asLine = false; } QByteArrayList toPrint;