X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient%2Fclient.cpp;h=9e22ce0867e8b4d0c4df083e9ca833c6aa3d996d;hb=ee6e4f90ce63d7eb3a54937cffb33510398d2349;hp=c73e49669ac6c603dd58dae7bcc2d6801e357f8e;hpb=8c38d6c5248c1b364bf56e25be0069f32c4f0408;p=quassel.git diff --git a/src/client/client.cpp b/src/client/client.cpp index c73e4966..9e22ce08 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -34,6 +34,7 @@ #include "util.h" QPointer Client::instanceptr = 0; +AccountId Client::_currentCoreAccount = 0; /*** Initialization/destruction ***/ @@ -71,7 +72,7 @@ Client::~Client() { } void Client::init() { - + _currentCoreAccount = 0; _networkModel = new NetworkModel(this); connect(this, SIGNAL(bufferUpdated(BufferInfo)), _networkModel, SLOT(bufferUpdated(BufferInfo))); @@ -116,6 +117,14 @@ void Client::init() { /*** public static methods ***/ +AccountId Client::currentCoreAccount() { + return _currentCoreAccount; +} + +void Client::setCurrentCoreAccount(AccountId id) { + _currentCoreAccount = id; +} + QList Client::allBufferInfos() { QList bufferids; foreach(Buffer *buffer, buffers()) { @@ -276,10 +285,11 @@ void Client::userInput(BufferInfo bufferInfo, QString message) { /*** core connection stuff ***/ -void Client::setConnectedToCore(QIODevice *sock) { +void Client::setConnectedToCore(QIODevice *sock, AccountId id) { socket = sock; signalProxy()->addPeer(socket); _connectedToCore = true; + setCurrentCoreAccount(id); } void Client::setSyncedToCore() { @@ -295,6 +305,7 @@ void Client::disconnectFromCore() { } _connectedToCore = false; _syncedToCore = false; + setCurrentCoreAccount(0); emit disconnected(); emit coreConnectionStateChanged(false);