From 5cabc167e646e9d80b70d6617a3f031d77453979 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 23 Jun 2017 10:20:03 +0200 Subject: Build with flatbuffers 1.7 There's a new template version that expects methods that QByteArray doesn't have but breaks the implicit conversion to const char *, std::string is safer anyways (doesn't require a null terminated string). --- common/bufferutils.h | 2 +- common/pipeline.cpp | 8 ++++---- common/resourceaccess.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/bufferutils.h b/common/bufferutils.h index 6763ced..f0460b7 100644 --- a/common/bufferutils.h +++ b/common/bufferutils.h @@ -38,7 +38,7 @@ static flatbuffers::Offset> modifiedPropertiesList; for (const auto &change : list) { - auto s = fbb.CreateString(change); + auto s = fbb.CreateString(change.toStdString()); modifiedPropertiesList.push_back(s); } return fbb.CreateVector(modifiedPropertiesList); diff --git a/common/pipeline.cpp b/common/pipeline.cpp index dc6f128..f29c7db 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -303,8 +303,8 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) SinkTraceCtx(d->logCtx) << "Move of " << current.identifier() << "was successfull"; if (isMove) { flatbuffers::FlatBufferBuilder fbb; - auto entityId = fbb.CreateString(current.identifier()); - auto type = fbb.CreateString(bufferType); + auto entityId = fbb.CreateString(current.identifier().toStdString()); + auto type = fbb.CreateString(bufferType.toStdString()); auto location = Sink::Commands::CreateDeleteEntity(fbb, current.revision(), entityId, type, true); Sink::Commands::FinishDeleteEntityBuffer(fbb, location); const auto data = BufferUtils::extractBuffer(fbb); @@ -450,8 +450,8 @@ void Preprocessor::createEntity(const Sink::ApplicationDomain::ApplicationDomain const auto entityBuffer = BufferUtils::extractBuffer(entityFbb); flatbuffers::FlatBufferBuilder fbb; - auto entityId = fbb.CreateString(entity.identifier()); - auto type = fbb.CreateString(typeName); + auto entityId = fbb.CreateString(entity.identifier().toStdString()); + auto type = fbb.CreateString(typeName.toStdString()); auto delta = Sink::EntityBuffer::appendAsVector(fbb, entityBuffer.constData(), entityBuffer.size()); auto location = Sink::Commands::CreateCreateEntity(fbb, entityId, type, delta); Sink::Commands::FinishCreateEntityBuffer(fbb, location); diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index cf8b2e0..808d892 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp @@ -477,7 +477,7 @@ void ResourceAccess::connected() { flatbuffers::FlatBufferBuilder fbb; - auto name = fbb.CreateString(QString("PID: %1 ResourceAccess: %2").arg(QCoreApplication::applicationPid()).arg(reinterpret_cast(this)).toLatin1()); + auto name = fbb.CreateString(QString("PID: %1 ResourceAccess: %2").arg(QCoreApplication::applicationPid()).arg(reinterpret_cast(this)).toLatin1().toStdString()); auto command = Sink::Commands::CreateHandshake(fbb, name); Sink::Commands::FinishHandshakeBuffer(fbb, command); Commands::write(d->socket.data(), ++d->messageId, Commands::HandshakeCommand, fbb); -- cgit v1.2.3