X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmonoapplication.cpp;h=e63c4d221d1e795b7341aea7f79f154f3ae1d712;hp=b6280793486a398ce7c71e565557b6fa543ec681;hb=d7832127ff8412b09d9fa4e56570d8a890abcbbe;hpb=0d49f7e83bd1055711e66aa880f3a0d62f7eefc9 diff --git a/src/qtui/monoapplication.cpp b/src/qtui/monoapplication.cpp index b6280793..e63c4d22 100644 --- a/src/qtui/monoapplication.cpp +++ b/src/qtui/monoapplication.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel IRC Team * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -30,10 +30,18 @@ MonolithicApplication::MonolithicApplication(int &argc, char **argv) _internalInitDone(false) { _internal = new CoreApplicationInternal(); // needed for parser options - setRunMode(Monolithic); + setRunMode(Quassel::Monolithic); } bool MonolithicApplication::init() { + if(!Quassel::init()) // parse args + return false; + + if(isOptionSet("port")) { + _internal->init(); + _internalInitDone = true; + } + connect(Client::instance(), SIGNAL(newClientSyncer(ClientSyncer *)), this, SLOT(newClientSyncer(ClientSyncer *))); return QtUiApplication::init(); } @@ -45,15 +53,15 @@ MonolithicApplication::~MonolithicApplication() { } void MonolithicApplication::newClientSyncer(ClientSyncer *syncer) { - connect(syncer, SIGNAL(startInternalCore()), this, SLOT(startInternalCore())); + connect(syncer, SIGNAL(startInternalCore(ClientSyncer *)), this, SLOT(startInternalCore(ClientSyncer *))); } -void MonolithicApplication::startInternalCore() { +void MonolithicApplication::startInternalCore(ClientSyncer *syncer) { if(!_internalInitDone) { _internal->init(); + _internalInitDone = true; } Core *core = Core::instance(); - ClientSyncer *syncer = static_cast(sender()); connect(syncer, SIGNAL(connectToInternalCore(SignalProxy *)), core, SLOT(setupInternalClientSession(SignalProxy *))); connect(core, SIGNAL(sessionState(const QVariant &)), syncer, SLOT(internalSessionStateReceived(const QVariant &))); }