From 9bc2e107c49f3cd983e68c5453851221d5096979 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 29 Apr 2015 10:10:36 +0200 Subject: Cleanup --- common/clientapi.h | 2 +- common/genericresource.cpp | 1 - common/resourceaccess.cpp | 12 +++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/clientapi.h b/common/clientapi.h index e1fe001..48177df 100644 --- a/common/clientapi.h +++ b/common/clientapi.h @@ -540,7 +540,7 @@ public: //TODO pass resource identifier to factory auto facade = FacadeFactory::instance().getFacade(resource); facade->load(query, resultSet).template then([&future](){future.setFinished();}).exec(); - //Keep the facade alive for the duration for the lifetime of the resultSet. + //Keep the facade alive for the lifetime of the resultSet. resultSet->setFacade(facade); }).template then([query, resultSet]() { resultSet->initialResultSetComplete(); diff --git a/common/genericresource.cpp b/common/genericresource.cpp index 0b71500..ea6413b 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp @@ -1,6 +1,5 @@ #include "genericresource.h" -#include "facade.h" #include "entitybuffer.h" #include "pipeline.h" #include "queuedcommand_generated.h" diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 28aaf2e..f448897 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp @@ -140,7 +140,9 @@ Async::Job ResourceAccess::Private::initializeSocket() //We failed to connect, so let's start the resource QStringList args; args << resourceName; - if (QProcess::startDetached("akonadi2_synchronizer", args, QDir::homePath())) { + qint64 pid = 0; + if (QProcess::startDetached("akonadi2_synchronizer", args, QDir::homePath(), &pid)) { + Trace() << "Started resource " << pid; tryToConnect() .then([&future]() { future.setFinished(); @@ -257,9 +259,9 @@ void ResourceAccess::sendCommand(const QSharedPointer &command) const auto messageId = d->messageId; log(QString("Sending command \"%1\" with messageId %2").arg(QString(Akonadi2::Commands::name(command->commandId))).arg(d->messageId)); if (command->callback) { - registerCallback(d->messageId, [this, messageId, command](int number, QString foo) { + registerCallback(d->messageId, [this, messageId, command](int errorCode, QString errorMessage) { d->pendingCommands.remove(messageId); - command->callback(number, foo); + command->callback(errorCode, errorMessage); }); } //Keep track of the command until we're sure it arrived @@ -336,7 +338,7 @@ bool ResourceAccess::processMessageBuffer() { static const int headerSize = Commands::headerSize(); if (d->partialMessageBuffer.size() < headerSize) { - qWarning() << "command too small"; + Warning() << "command too small"; return false; } @@ -345,7 +347,7 @@ bool ResourceAccess::processMessageBuffer() const uint size = *(int*)(d->partialMessageBuffer.constData() + sizeof(int) + sizeof(uint)); if (size > (uint)(d->partialMessageBuffer.size() - headerSize)) { - qWarning() << "command too small"; + Warning() << "command too small"; return false; } -- cgit v1.2.3