X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fnetwork.cpp;h=58171fe00391889c5e43d329a99936f1cb6aa97f;hb=6e50e532fa24b8e36237eb7ae9c5c9b21058519f;hp=c813ebbc54ed9d25dee4058c5f9149e407d5a3d7;hpb=98e2e99d0441ffd1988095473048519593b1a701;p=quassel.git diff --git a/src/common/network.cpp b/src/common/network.cpp index c813ebbc..58171fe0 100644 --- a/src/common/network.cpp +++ b/src/common/network.cpp @@ -36,6 +36,7 @@ Network::Network(const NetworkId &networkid, QObject *parent) _networkId(networkid), _identity(0), _myNick(QString()), + _latency(0), _networkName(QString("")), _currentServer(QString()), _connected(false), @@ -429,6 +430,13 @@ void Network::setMyNick(const QString &nickname) { emit myNickSet(nickname); } +void Network::setLatency(int latency) { + if(_latency == latency) + return; + _latency = latency; + emit latencySet(latency); +} + void Network::setIdentity(IdentityId id) { _identity = id; emit identitySet(id); @@ -529,7 +537,7 @@ QVariantMap Network::initIrcUsersAndChannels() const { QHash::const_iterator channelIter = _ircChannels.constBegin(); QHash::const_iterator channelIterEnd = _ircChannels.constEnd(); while(channelIter != channelIterEnd) { - channels[channelIter.key()] = channelIter.value()->toVariantMap(); + channels[channelIter.value()->name()] = channelIter.value()->toVariantMap(); channelIter++; } usersAndChannels["channels"] = channels; @@ -539,7 +547,7 @@ QVariantMap Network::initIrcUsersAndChannels() const { void Network::initSetIrcUsersAndChannels(const QVariantMap &usersAndChannels) { Q_ASSERT(proxy()); - if(!_ircUsers.isEmpty() || !_ircChannels.isEmpty()) { + if(isInitialized()) { qWarning() << "Network" << networkId() << "received init data for users and channels allthough there allready are known users or channels!"; return; }