summaryrefslogtreecommitdiffstats
path: root/common/resourceaccess.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-19 20:21:21 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-19 20:25:29 +0200
commit440322eb73a16e2afbe118e457cc0a69aea41e3f (patch)
tree59739b632d9c87a958a5d84d42eeafed13044f04 /common/resourceaccess.cpp
parent20f6d6470bbb812d0aecd68c2fbb148daebd14d7 (diff)
downloadsink-440322eb73a16e2afbe118e457cc0a69aea41e3f.tar.gz
sink-440322eb73a16e2afbe118e457cc0a69aea41e3f.zip
The callback is supposed to be always there
Diffstat (limited to 'common/resourceaccess.cpp')
-rw-r--r--common/resourceaccess.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp
index 038e240..78a5155 100644
--- a/common/resourceaccess.cpp
+++ b/common/resourceaccess.cpp
@@ -273,12 +273,12 @@ void ResourceAccess::sendCommand(const QSharedPointer<QueuedCommand> &command)
273 d->messageId++; 273 d->messageId++;
274 const auto messageId = d->messageId; 274 const auto messageId = d->messageId;
275 log(QString("Sending command \"%1\" with messageId %2").arg(QString(Akonadi2::Commands::name(command->commandId))).arg(d->messageId)); 275 log(QString("Sending command \"%1\" with messageId %2").arg(QString(Akonadi2::Commands::name(command->commandId))).arg(d->messageId));
276 if (command->callback) { 276 Q_ASSERT(command->callback);
277 registerCallback(d->messageId, [this, messageId, command](int errorCode, QString errorMessage) { 277 registerCallback(d->messageId, [this, messageId, command](int errorCode, QString errorMessage) {
278 d->pendingCommands.remove(messageId); 278 Trace() << "Command complete " << messageId;
279 command->callback(errorCode, errorMessage); 279 d->pendingCommands.remove(messageId);
280 }); 280 command->callback(errorCode, errorMessage);
281 } 281 });
282 //Keep track of the command until we're sure it arrived 282 //Keep track of the command until we're sure it arrived
283 d->pendingCommands.insert(d->messageId, command); 283 d->pendingCommands.insert(d->messageId, command);
284 Commands::write(d->socket.data(), d->messageId, command->commandId, command->buffer.constData(), command->buffer.size()); 284 Commands::write(d->socket.data(), d->messageId, command->commandId, command->buffer.constData(), command->buffer.size());