X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=core%2Fcoreproxy.cpp;h=11fdf95bc99630a8a4cdf9db532a5f74c390721b;hp=9ea3e68e2864ce95f7d72d488836ffea7b625e22;hb=d6a96a47a3964b9c0b1ea2413601d70d0d327413;hpb=ba8f57d654b07d77cc91a2b901ad3b664a31ffcf diff --git a/core/coreproxy.cpp b/core/coreproxy.cpp index 9ea3e68e..11fdf95b 100644 --- a/core/coreproxy.cpp +++ b/core/coreproxy.cpp @@ -23,9 +23,12 @@ #include "coreproxy.h" #include "global.h" #include "util.h" +#include "core.h" CoreProxy::CoreProxy() { if(coreProxy) qFatal("Trying to instantiate more than one CoreProxy object!"); + coreProxy = this; + core = new Core(); connect(global, SIGNAL(dataPutLocally(QString)), this, SLOT(updateGlobalData(QString))); connect(&server, SIGNAL(newConnection()), this, SLOT(incomingConnection())); @@ -85,11 +88,19 @@ void CoreProxy::processClientInit(QTcpSocket *socket, const QVariant &v) { coreData[key] = global->getData(key); } reply["CoreData"] = coreData; - //QVariant payload = QByteArray(1000000, 'a'); - //reply["payload"] = payload; + VarMap bl; + QHash > log = core->getBackLog(); + foreach(QString net, log.keys()) { + QByteArray buf; + QDataStream out(&buf, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_2); + foreach(Message msg, log[net]) { out << msg; } + bl[net] = buf; + } + reply["CoreBackLog"] = bl; QList sigdata; sigdata.append(CS_CORE_STATE); sigdata.append(QVariant(reply)); sigdata.append(QVariant()); sigdata.append(QVariant()); writeDataToDevice(socket, QVariant(sigdata)); + emit requestServerStates(); } void CoreProxy::processClientUpdate(QTcpSocket *socket, QString key, QVariant data) { @@ -122,8 +133,8 @@ void CoreProxy::recv(GUISignal sig, QVariant arg1, QVariant arg2, QVariant arg3) //qDebug() << "[CORE] Received signal" << sig << ":" << arg1<