X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=core%2Fcore.cpp;h=7c341d573b342831a42a893a9c2237ab5d75b4a8;hp=4d14402324dbccb7bbde5c1d90e73405c2803cb5;hb=31d998779868a1b572972168b2e813893d70ab90;hpb=a975272aca8f0deb25c395532b189141979304e5 diff --git a/core/core.cpp b/core/core.cpp index 4d144023..7c341d57 100644 --- a/core/core.cpp +++ b/core/core.cpp @@ -19,12 +19,51 @@ ***************************************************************************/ #include "core.h" +#include "server.h" +#include "quassel.h" +#include "coreproxy.h" #include +Core::Core() { + if(core) qFatal("Trying to instantiate more than one Core object!"); + + connect(coreProxy, SIGNAL(gsRequestConnect(QString, quint16)), this, SLOT(connectToIrc(QString, quint16))); + connect(coreProxy, SIGNAL(gsUserInput(QString)), this, SLOT(inputLine(QString))); + + connect(&server, SIGNAL(recvLine(QString)), coreProxy, SLOT(csCoreMessage(QString))); + + QSettings s; + VarMap identities = s.value("Network/Identities").toMap(); + //VarMap networks = s.value("Network/ + quassel->putData("Identities", identities); + + server.start(); +} + void Core::init() { +} + +/* +void Core::run() { + + connect(&server, SIGNAL(recvLine(const QString &)), this, SIGNAL(outputLine(const QString &))); + //connect( + server.start(); + exec(); +} +*/ + +void Core::connectToIrc(const QString &h, quint16 port) { + qDebug() << "Core: Connecting to " << h << ":" << port; + server.connectToIrc(h, port); +} + +void Core::inputLine(QString s) { + server.putRawLine(s); + } VarMap Core::loadIdentities() { @@ -36,3 +75,5 @@ void Core::storeIdentities(VarMap identities) { QSettings s; s.setValue("Network/Identities", identities); } + +Core *core;