X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=core%2Fcore.cpp;h=7c341d573b342831a42a893a9c2237ab5d75b4a8;hp=10c9d3d65d0929f547567ea281f6ff522b4f8242;hb=31d998779868a1b572972168b2e813893d70ab90;hpb=8b192b08f3df4ce0e7cc4a08564645c76efa688d diff --git a/core/core.cpp b/core/core.cpp index 10c9d3d6..7c341d57 100644 --- a/core/core.cpp +++ b/core/core.cpp @@ -20,31 +20,49 @@ #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(this, SIGNAL(connectToIrc( const QString&, quint16 )), &server, SLOT(connectToIrc( const QString&, quint16 ))); connect(&server, SIGNAL(recvLine(const QString &)), this, SIGNAL(outputLine(const QString &))); //connect( server.start(); - qDebug() << "Core running..."; - 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); } @@ -57,3 +75,5 @@ void Core::storeIdentities(VarMap identities) { QSettings s; s.setValue("Network/Identities", identities); } + +Core *core;