this, SLOT(userModeChanged(IrcUser *)));
connect(ircChannel, SIGNAL(ircUserModeRemoved(IrcUser *, QString)),
this, SLOT(userModeChanged(IrcUser *)));
+
+ if(!ircChannel->ircUsers().isEmpty()) {
+ qWarning() << "Channel" << ircChannel->name() << "has already users which is quite surprising :)";
+ foreach(IrcUser *ircUser, ircChannel->ircUsers()) {
+ join(ircUser);
+ }
+ }
emit dataChanged();
}
if(!success) {
+ qDebug() << "didn't find User:" << ircUser << (quint64)ircUser;
qDebug() << "==== Childlist for Item:" << this << id() << bufferName() << "====";
for(int i = 0; i < childCount(); i++) {
categoryItem = qobject_cast<UserCategoryItem *>(child(i));
return _networkId.toInt();
}
+void NetworkItem::setActive(bool connected) {
+ Q_UNUSED(connected);
+ emit dataChanged();
+}
+
bool NetworkItem::isActive() const {
- return _network;
+ if(_network)
+ return _network->isConnected();
+ else
+ return false;
}
QString NetworkItem::networkName() const {
this, SLOT(setCurrentServer(QString)));
connect(network, SIGNAL(ircChannelAdded(QString)),
this, SLOT(attachIrcChannel(QString)));
+ connect(network, SIGNAL(connectedSet(bool)),
+ this, SLOT(setActive(bool)));
+
// FIXME: connect this and that...
emit dataChanged();
QVariant UserCategoryItem::data(int column, int role) const {
switch(role) {
+ case NetworkModel::ItemActiveRole:
+ return true;
case NetworkModel::ItemTypeRole:
return NetworkModel::UserCategoryItemType;
case NetworkModel::BufferIdRole:
QVariant IrcUserItem::data(int column, int role) const {
switch(role) {
+ case NetworkModel::ItemActiveRole:
+ return !_ircUser->isAway();
case NetworkModel::ItemTypeRole:
return NetworkModel::IrcUserItemType;
case NetworkModel::BufferIdRole:
QString IrcUserItem::toolTip(int column) const {
Q_UNUSED(column);
- return "<p><b>" + nickName() + "</b><br />" + _ircUser->hostmask() + "</p>";
+ QString toolTip = "<b>" + nickName() + "</b><br />" + _ircUser->hostmask();
+ if(_ircUser->isAway()) {
+ toolTip += "<br /> away";
+ if(!_ircUser->awayMessage().isEmpty()) {
+ toolTip += " (" + _ircUser->awayMessage() + ")";
+ }
+ }
+ return "<p>" + toolTip + "</p>";
}
void IrcUserItem::setNick(QString newNick) {