/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel Project *
+ * Copyright (C) 2005-09 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
}
void InputWidget::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) {
+ Q_UNUSED(previous)
NetworkId networkId = current.data(NetworkModel::NetworkIdRole).value<NetworkId>();
- NetworkId previousNetworkId = previous.data(NetworkModel::NetworkIdRole).value<NetworkId>();
- if(networkId == previousNetworkId)
+ if(networkId == _networkId)
return;
setNetwork(networkId);
const Network *network = Client::network(networkId);
if(network) {
connect(network, SIGNAL(identitySet(IdentityId)), this, SLOT(setIdentity(IdentityId)));
- if(network->me())
- connectMyIrcUser();
- else
- connect(network, SIGNAL(myNickSet(const QString &)), this, SLOT(connectMyIrcUser()));
+ connectMyIrcUser();
setIdentity(network->identity());
} else {
setIdentity(0);
+ _networkId = 0;
}
}
connect(network->me(), SIGNAL(userModesRemoved(QString)), this, SLOT(updateNickSelector()));
connect(network->me(), SIGNAL(awaySet(bool)), this, SLOT(updateNickSelector()));
disconnect(network, SIGNAL(myNickSet(const QString &)), this, SLOT(connectMyIrcUser()));
+ } else {
+ connect(network, SIGNAL(myNickSet(const QString &)), this, SLOT(connectMyIrcUser()));
}
}