fixed a major bug introduced in r456 (segfault on core exit)
[quassel.git] / src / common / ircchannel.cpp
index 5c12171..edb2c71 100644 (file)
@@ -40,11 +40,10 @@ IrcChannel::IrcChannel(const QString &channelname, Network *network)
     _topic(QString()),
     network(network)
 {
-  setObjectName(QString::number(network->networkId()) + "/" +  channelname);
+  setObjectName(QString::number(network->networkId().toInt()) + "/" +  channelname);
 }
 
 IrcChannel::~IrcChannel() {
-
 }
 
 // ====================
@@ -143,7 +142,7 @@ void IrcChannel::setTopic(const QString &topic) {
 void IrcChannel::join(IrcUser *ircuser) {
   if(!_userModes.contains(ircuser) && ircuser) {
     _userModes[ircuser] = QString();
-    ircuser->joinChannel(name());
+    ircuser->joinChannel(this);
     //qDebug() << "JOIN" << name() << ircuser->nick() << ircUsers().count();
     connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString)));
     connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
@@ -160,10 +159,11 @@ void IrcChannel::join(const QString &nick) {
 void IrcChannel::part(IrcUser *ircuser) {
   if(isKnownUser(ircuser)) {
     _userModes.remove(ircuser);
-    ircuser->partChannel(name());
+    ircuser->partChannel(this);
     //qDebug() << "PART" << name() << ircuser->nick() << ircUsers().count();
     // if you wonder why there is no counterpart to ircUserParted:
     // the joines are propagted by the ircuser. the signal ircUserParted is only for convenience
+    disconnect(ircuser, 0, this, 0);
     emit ircUserParted(ircuser);
     if(network->isMe(ircuser))
        deleteLater();