summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-04-29 10:10:36 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-04-29 10:10:36 +0200
commit9bc2e107c49f3cd983e68c5453851221d5096979 (patch)
tree95664d0461ecb688f3a068fc5797e0bd370be692
parentb0e7af2972b82364f8ca95fef8031cbd018d54e0 (diff)
downloadsink-9bc2e107c49f3cd983e68c5453851221d5096979.tar.gz
sink-9bc2e107c49f3cd983e68c5453851221d5096979.zip
Cleanup
-rw-r--r--common/clientapi.h2
-rw-r--r--common/genericresource.cpp1
-rw-r--r--common/resourceaccess.cpp12
3 files changed, 8 insertions, 7 deletions
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:
540 //TODO pass resource identifier to factory 540 //TODO pass resource identifier to factory
541 auto facade = FacadeFactory::instance().getFacade<DomainType>(resource); 541 auto facade = FacadeFactory::instance().getFacade<DomainType>(resource);
542 facade->load(query, resultSet).template then<void>([&future](){future.setFinished();}).exec(); 542 facade->load(query, resultSet).template then<void>([&future](){future.setFinished();}).exec();
543 //Keep the facade alive for the duration for the lifetime of the resultSet. 543 //Keep the facade alive for the lifetime of the resultSet.
544 resultSet->setFacade(facade); 544 resultSet->setFacade(facade);
545 }).template then<void>([query, resultSet]() { 545 }).template then<void>([query, resultSet]() {
546 resultSet->initialResultSetComplete(); 546 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 @@
1#include "genericresource.h" 1#include "genericresource.h"
2 2
3#include "facade.h"
4#include "entitybuffer.h" 3#include "entitybuffer.h"
5#include "pipeline.h" 4#include "pipeline.h"
6#include "queuedcommand_generated.h" 5#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<void> ResourceAccess::Private::initializeSocket()
140 //We failed to connect, so let's start the resource 140 //We failed to connect, so let's start the resource
141 QStringList args; 141 QStringList args;
142 args << resourceName; 142 args << resourceName;
143 if (QProcess::startDetached("akonadi2_synchronizer", args, QDir::homePath())) { 143 qint64 pid = 0;
144 if (QProcess::startDetached("akonadi2_synchronizer", args, QDir::homePath(), &pid)) {
145 Trace() << "Started resource " << pid;
144 tryToConnect() 146 tryToConnect()
145 .then<void>([&future]() { 147 .then<void>([&future]() {
146 future.setFinished(); 148 future.setFinished();
@@ -257,9 +259,9 @@ void ResourceAccess::sendCommand(const QSharedPointer<QueuedCommand> &command)
257 const auto messageId = d->messageId; 259 const auto messageId = d->messageId;
258 log(QString("Sending command \"%1\" with messageId %2").arg(QString(Akonadi2::Commands::name(command->commandId))).arg(d->messageId)); 260 log(QString("Sending command \"%1\" with messageId %2").arg(QString(Akonadi2::Commands::name(command->commandId))).arg(d->messageId));
259 if (command->callback) { 261 if (command->callback) {
260 registerCallback(d->messageId, [this, messageId, command](int number, QString foo) { 262 registerCallback(d->messageId, [this, messageId, command](int errorCode, QString errorMessage) {
261 d->pendingCommands.remove(messageId); 263 d->pendingCommands.remove(messageId);
262 command->callback(number, foo); 264 command->callback(errorCode, errorMessage);
263 }); 265 });
264 } 266 }
265 //Keep track of the command until we're sure it arrived 267 //Keep track of the command until we're sure it arrived
@@ -336,7 +338,7 @@ bool ResourceAccess::processMessageBuffer()
336{ 338{
337 static const int headerSize = Commands::headerSize(); 339 static const int headerSize = Commands::headerSize();
338 if (d->partialMessageBuffer.size() < headerSize) { 340 if (d->partialMessageBuffer.size() < headerSize) {
339 qWarning() << "command too small"; 341 Warning() << "command too small";
340 return false; 342 return false;
341 } 343 }
342 344
@@ -345,7 +347,7 @@ bool ResourceAccess::processMessageBuffer()
345 const uint size = *(int*)(d->partialMessageBuffer.constData() + sizeof(int) + sizeof(uint)); 347 const uint size = *(int*)(d->partialMessageBuffer.constData() + sizeof(int) + sizeof(uint));
346 348
347 if (size > (uint)(d->partialMessageBuffer.size() - headerSize)) { 349 if (size > (uint)(d->partialMessageBuffer.size() - headerSize)) {
348 qWarning() << "command too small"; 350 Warning() << "command too small";
349 return false; 351 return false;
350 } 352 }
351 353