X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=core%2Fcoreproxy.cpp;h=c6325eef3a828095d6db2b8d309364c19b9844d8;hb=7ec4585cecc74ce8d9a94b0e52f00a96d105e79e;hp=ab0038429558609bb7d45be122a3c6345f19469b;hpb=31d998779868a1b572972168b2e813893d70ab90;p=quassel.git diff --git a/core/coreproxy.cpp b/core/coreproxy.cpp index ab003842..c6325eef 100644 --- a/core/coreproxy.cpp +++ b/core/coreproxy.cpp @@ -18,16 +18,60 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "coreproxy.h" #include +#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!"); +// connect(global, SIGNAL(dataPutLocally(QString)), this, SLOT(updateGlobalData(QString))); +// connect(&server, SIGNAL(newConnection()), this, SLOT(incomingConnection())); +} + +/* +void CoreProxy::processClientUpdate(QTcpSocket *socket, QString key, QVariant data) { + global->updateData(key, data); + QList sigdata; + sigdata.append(CS_UPDATE_GLOBAL_DATA); sigdata.append(key); sigdata.append(data); sigdata.append(QVariant()); + QTcpSocket *s; + foreach(s, clients) { + if(s != socket) writeDataToDevice(s, QVariant(sigdata)); + } +} +void CoreProxy::updateGlobalData(QString key) { + QVariant data = global->getData(key); + emit csUpdateGlobalData(key, data); } +*/ + +/* +void CoreProxy::send(CoreSignal sig, QVariant arg1, QVariant arg2, QVariant arg3) { -void CoreProxy::csCoreMessage(QString s) { - send(CS_CORE_MESSAGE, s); + QList sigdata; + sigdata.append(sig); sigdata.append(arg1); sigdata.append(arg2); sigdata.append(arg3); + //qDebug() << "Sending signal: " << sigdata; + QTcpSocket *socket; + foreach(socket, clients) { + writeDataToDevice(socket, QVariant(sigdata)); + } } +*/ + +void CoreProxy::recv(GUISignal sig, QVariant arg1, QVariant arg2, QVariant arg3) { + //qDebug() << "[CORE] Received signal" << sig << ":" << arg1<(), arg2.toString()); break; + case GS_REQUEST_CONNECT: emit gsRequestConnect(arg1.toStringList()); break; + case GS_IMPORT_BACKLOG: emit gsImportBacklog(); break; + case GS_REQUEST_BACKLOG: emit gsRequestBacklog(arg1.value(), arg2, arg3); break; + //default: qWarning() << "Unknown signal in CoreProxy::recv: " << sig; + default: emit gsGeneric(sig, arg1, arg2, arg3); + } +} + -CoreProxy *coreProxy; +//CoreProxy *coreProxy;