From a35acab8ecdadb5547c445a41ca2a67d978ed4a6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 18 Apr 2015 12:16:34 +0200 Subject: Log messages --- common/commands.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'common/commands.cpp') diff --git a/common/commands.cpp b/common/commands.cpp index 1dfeabe..99313b9 100644 --- a/common/commands.cpp +++ b/common/commands.cpp @@ -28,6 +28,39 @@ namespace Akonadi2 namespace Commands { +QByteArray name(int commandId) +{ + switch(commandId) { + case UnknownCommand: + return "Unknown"; + case CommandCompletion: + return "Completion"; + case HandshakeCommand: + return "Handshake"; + case RevisionUpdateCommand: + return "RevisionUpdate"; + case SynchronizeCommand: + return "Synchronize"; + case FetchEntityCommand: + return "FetchEntity"; + case DeleteEntityCommand: + return "DeleteEntity"; + case ModifyEntityCommand: + return "ModifyEntity"; + case CreateEntityCommand: + return "CreateEntity"; + case SearchSourceCommand: + return "SearchSource"; + case ShutdownCommand: + return "Shutdown"; + case NotificationCommand: + return "Notification"; + case CustomCommand: + return "Custom"; + }; + return QByteArray("Invalid commandId"); +} + int headerSize() { return sizeof(int) + (sizeof(uint) * 2); -- cgit v1.2.3