void ChannelBufferItem::attachIrcChannel(IrcChannel *ircChannel) { if (_ircChannel) { qWarning() << Q_FUNC_INFO << "IrcChannel already set; cleanup failed!?"; disconnect(_ircChannel, 0, this, 0); } _ircChannel = ircChannel; connect(ircChannel, SIGNAL(destroyed(QObject*)), this, SLOT(ircChannelDestroyed())); connect(ircChannel, SIGNAL(topicSet(QString)), this, SLOT(setTopic(QString))); connect(ircChannel, SIGNAL(encryptedSet(bool)), this, SLOT(setEncrypted(bool))); connect(ircChannel, SIGNAL(ircUsersJoined(QList<IrcUser *> )), this, SLOT(join(QList<IrcUser *> ))); connect(ircChannel, SIGNAL(ircUserParted(IrcUser *)), this, SLOT(part(IrcUser *))); connect(ircChannel, SIGNAL(parted()), this, SLOT(ircChannelParted())); connect(ircChannel, SIGNAL(ircUserModesSet(IrcUser *, QString)), this, SLOT(userModeChanged(IrcUser *))); connect(ircChannel, SIGNAL(ircUserModeAdded(IrcUser *, QString)), this, SLOT(userModeChanged(IrcUser *))); connect(ircChannel, SIGNAL(ircUserModeRemoved(IrcUser *, QString)), this, SLOT(userModeChanged(IrcUser *))); if (!ircChannel->ircUsers().isEmpty()) join(ircChannel->ircUsers()); emit dataChanged(); }
void ChannelBufferItem::attachIrcChannel(IrcChannel *ircChannel) { Q_ASSERT(!_ircChannel && ircChannel); _ircChannel = ircChannel; connect(ircChannel, SIGNAL(topicSet(QString)), this, SLOT(setTopic(QString))); connect(ircChannel, SIGNAL(encryptedSet(bool)), this, SLOT(setEncrypted(bool))); connect(ircChannel, SIGNAL(ircUsersJoined(QList<IrcUser *> )), this, SLOT(join(QList<IrcUser *> ))); connect(ircChannel, SIGNAL(ircUserParted(IrcUser *)), this, SLOT(part(IrcUser *))); connect(ircChannel, SIGNAL(parted()), this, SLOT(ircChannelParted())); connect(ircChannel, SIGNAL(ircUserModesSet(IrcUser *, QString)), this, SLOT(userModeChanged(IrcUser *))); connect(ircChannel, SIGNAL(ircUserModeAdded(IrcUser *, QString)), this, SLOT(userModeChanged(IrcUser *))); connect(ircChannel, SIGNAL(ircUserModeRemoved(IrcUser *, QString)), this, SLOT(userModeChanged(IrcUser *))); if (!ircChannel->ircUsers().isEmpty()) join(ircChannel->ircUsers()); emit dataChanged(); }
// ==================== // PUBLIC SLOTS: // ==================== void IrcChannel::setTopic(const QString &topic) { _topic = topic; SYNC(ARG(topic)) emit topicSet(topic); }