X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresession.cpp;h=f868379bb34cc4ed6dfdd788c42bf9a72b1617b7;hp=68f31271f88b19571ffd09648d305d498f85bb08;hb=70ed7f4b13ab21a9b3dcb61386b56ad324ed697d;hpb=cc7f376eb105f7bf931fb7f96c9601a7b3f69511 diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 68f31271..f868379b 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -23,6 +23,7 @@ #include "core.h" #include "coresession.h" #include "networkconnection.h" +#include "userinputhandler.h" #include "signalproxy.h" #include "buffersyncer.h" @@ -30,7 +31,7 @@ #include "corebufferviewmanager.h" #include "storage.h" -#include "network.h" +#include "corenetwork.h" #include "ircuser.h" #include "ircchannel.h" #include "identity.h" @@ -98,7 +99,7 @@ CoreSession::~CoreSession() { foreach(NetworkConnection *conn, _connections.values()) { delete conn; } - foreach(Network *net, _networks.values()) { + foreach(CoreNetwork *net, _networks.values()) { delete net; } } @@ -107,7 +108,7 @@ UserId CoreSession::user() const { return _user; } -Network *CoreSession::network(NetworkId id) const { +CoreNetwork *CoreSession::network(NetworkId id) const { if(_networks.contains(id)) return _networks[id]; return 0; } @@ -169,7 +170,7 @@ void CoreSession::updateBufferInfo(UserId uid, const BufferInfo &bufinfo) { } void CoreSession::connectToNetwork(NetworkId id) { - Network *net = network(id); + CoreNetwork *net = network(id); if(!net) { qWarning() << "Connect to unknown network requested! net:" << id << "user:" << user(); return; @@ -205,8 +206,11 @@ void CoreSession::attachNetworkConnection(NetworkConnection *conn) { } void CoreSession::disconnectFromNetwork(NetworkId id) { - if(!_connections.contains(id)) return; - _connections[id]->disconnectFromIrc(); + if(!_connections.contains(id)) + return; + + //_connections[id]->disconnectFromIrc(); + _connections[id]->userInputHandler()->handleQuit(BufferInfo(), QString()); } void CoreSession::networkStateRequested() { @@ -404,7 +408,7 @@ void CoreSession::createNetwork(const NetworkInfo &info_) { id = info.networkId.toInt(); if(!_networks.contains(id)) { - Network *net = new Network(id, this); + CoreNetwork *net = new CoreNetwork(id, this); connect(net, SIGNAL(connectRequested(NetworkId)), this, SLOT(connectToNetwork(NetworkId))); connect(net, SIGNAL(disconnectRequested(NetworkId)), this, SLOT(disconnectFromNetwork(NetworkId))); net->setNetworkInfo(info); @@ -418,6 +422,7 @@ void CoreSession::createNetwork(const NetworkInfo &info_) { } } +// FIXME: move to CoreNetwork void CoreSession::updateNetwork(const NetworkInfo &info) { if(!_networks.contains(info.networkId)) { qWarning() << "Update request for unknown network received!"; @@ -468,7 +473,7 @@ void CoreSession::removeBufferRequested(BufferId bufferId) { } if(bufferInfo.type() == BufferInfo::ChannelBuffer) { - Network *net = network(bufferInfo.networkId()); + CoreNetwork *net = network(bufferInfo.networkId()); if(!net) { qWarning() << "CoreSession::removeBufferRequested(): Received BufferInfo with unknown networkId!"; return;