X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=core%2Fcore.cpp;h=7c341d573b342831a42a893a9c2237ab5d75b4a8;hp=b7f0e39ce82284b60ab586e3828daf0a2fb8f124;hb=31d998779868a1b572972168b2e813893d70ab90;hpb=e368a1672c4f917bfa6adb52dae3b5ebfcd0db18 diff --git a/core/core.cpp b/core/core.cpp index b7f0e39c..7c341d57 100644 --- a/core/core.cpp +++ b/core/core.cpp @@ -21,19 +21,32 @@ #include "core.h" #include "server.h" #include "quassel.h" +#include "coreproxy.h" #include -Core * Core::init() { - if(core) return core; +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(); - qDebug() << identities; //VarMap networks = s.value("Network/ quassel->putData("Identities", identities); - return new Core(); + + server.start(); +} + +void Core::init() { + + } +/* void Core::run() { connect(&server, SIGNAL(recvLine(const QString &)), this, SIGNAL(outputLine(const QString &))); @@ -41,13 +54,15 @@ void Core::run() { server.start(); exec(); } +*/ -void Core::connectToIrc( const QString &h, quint16 port) { +void Core::connectToIrc(const QString &h, quint16 port) { + qDebug() << "Core: Connecting to " << h << ":" << port; server.connectToIrc(h, port); } -void Core::inputLine(const QString &s) { - server.putRawLine( s); +void Core::inputLine(QString s) { + server.putRawLine(s); }