From 121a7a9291abd0f49aab836a47c8afcae66da18e Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Thu, 7 Nov 2013 23:41:05 +0100 Subject: [PATCH] SessionState needs to be a registered meta type This is because the mono client sends the session state through a queued signal connection. --- src/common/protocol.h | 2 +- src/common/quassel.cpp | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/common/protocol.h b/src/common/protocol.h index 89ef4073..80b00de0 100644 --- a/src/common/protocol.h +++ b/src/common/protocol.h @@ -141,6 +141,7 @@ struct LoginSuccess : public HandshakeMessage // TODO: more generic format struct SessionState : public HandshakeMessage { + inline SessionState() {} // needed for QMetaType (for the mono client) inline SessionState(const QVariantList &identities, const QVariantList &bufferInfos, const QVariantList &networkIds) : identities(identities), bufferInfos(bufferInfos), networkIds(networkIds) {} @@ -149,7 +150,6 @@ struct SessionState : public HandshakeMessage QVariantList networkIds; }; - /*** handled by SignalProxy ***/ struct SignalProxyMessage diff --git a/src/common/quassel.cpp b/src/common/quassel.cpp index e0817756..66aae90b 100644 --- a/src/common/quassel.cpp +++ b/src/common/quassel.cpp @@ -29,18 +29,19 @@ #include #include #include +#include #include #include #include -#include -#include "message.h" +#include "bufferinfo.h" #include "identity.h" +#include "logger.h" +#include "message.h" #include "network.h" -#include "bufferinfo.h" -#include "types.h" +#include "protocol.h" #include "syncableobject.h" -#include "logger.h" +#include "types.h" Quassel::BuildInfo Quassel::_buildInfo; AbstractCliParser *Quassel::_cliParser = 0; @@ -194,6 +195,8 @@ void Quassel::registerMetaTypes() qRegisterMetaTypeStreamOperators("AccountId"); qRegisterMetaTypeStreamOperators("MsgId"); + qRegisterMetaType("Protocol::SessionState"); + // Versions of Qt prior to 4.7 didn't define QVariant as a meta type if (!QMetaType::type("QVariant")) { qRegisterMetaType("QVariant"); -- 2.20.1