projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merging r732:766 from trunk to branches/0.3.
[quassel.git]
/
src
/
client
/
networkmodel.cpp
diff --git
a/src/client/networkmodel.cpp
b/src/client/networkmodel.cpp
index
63ebf9a
..
bec3edf
100644
(file)
--- a/
src/client/networkmodel.cpp
+++ b/
src/client/networkmodel.cpp
@@
-41,7
+41,8
@@
BufferItem::BufferItem(BufferInfo bufferInfo, AbstractTreeItem *parent)
: PropertyMapItem(QStringList() << "bufferName" << "topic" << "nickCount", parent),
_bufferInfo(bufferInfo),
_bufferName(bufferInfo.bufferName()),
: PropertyMapItem(QStringList() << "bufferName" << "topic" << "nickCount", parent),
_bufferInfo(bufferInfo),
_bufferName(bufferInfo.bufferName()),
- _activity(Buffer::NoActivity)
+ _activity(Buffer::NoActivity),
+ _ircChannel(0)
{
Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
if(bufferType() == BufferInfo::QueryBuffer)
{
Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
if(bufferType() == BufferInfo::QueryBuffer)
@@
-144,6
+145,9
@@
void BufferItem::attachIrcChannel(IrcChannel *ircChannel) {
}
void BufferItem::ircChannelDestroyed() {
}
void BufferItem::ircChannelDestroyed() {
+ Q_CHECK_PTR(_ircChannel);
+ disconnect(_ircChannel, 0, this, 0);
+ _ircChannel = 0;
emit dataChanged();
removeAllChilds();
}
emit dataChanged();
removeAllChilds();
}
@@
-414,7
+418,9
@@
void NetworkItem::attachNetwork(Network *network) {
this, SLOT(attachIrcChannel(QString)));
connect(network, SIGNAL(connectedSet(bool)),
this, SIGNAL(dataChanged()));
this, SLOT(attachIrcChannel(QString)));
connect(network, SIGNAL(connectedSet(bool)),
this, SIGNAL(dataChanged()));
-
+ connect(network, SIGNAL(destroyed()),
+ this, SIGNAL(dataChanged()));
+
emit dataChanged();
}
emit dataChanged();
}
@@
-462,10
+468,6
@@
QString NetworkItem::toolTip(int column) const {
*****************************************/
// we hardcode this even though we have PREFIX in network... but that wouldn't help with mapping modes to
// category strings anyway.
*****************************************/
// we hardcode this even though we have PREFIX in network... but that wouldn't help with mapping modes to
// category strings anyway.
-// TODO make this translateable depending on the number of users in a category
-// -> we can't set the real string here, because tr() needs to get the actual number as second param
-// -> tr("%n User(s)", n) needs to be used somewhere where we do know the user number n
-
const QList<QChar> UserCategoryItem::categories = QList<QChar>() << 'q' << 'a' << 'o' << 'h' << 'v';
UserCategoryItem::UserCategoryItem(int category, AbstractTreeItem *parent)
const QList<QChar> UserCategoryItem::categories = QList<QChar>() << 'q' << 'a' << 'o' << 'h' << 'v';
UserCategoryItem::UserCategoryItem(int category, AbstractTreeItem *parent)
@@
-530,7
+532,7
@@
QVariant UserCategoryItem::data(int column, int role) const {
}
}
}
}
-
+
/*****************************************
* Irc User Items
*****************************************/
/*****************************************
* Irc User Items
*****************************************/
@@
-594,7
+596,10
@@
QString IrcUserItem::toolTip(int column) const {
if(_ircUser->isAway()) toolTip[0].append(" is away");
if(!_ircUser->awayMessage().isEmpty()) toolTip[0].append(QString(" (%1)").arg(_ircUser->awayMessage()));
if(!_ircUser->realName().isEmpty()) toolTip.append(_ircUser->realName());
if(_ircUser->isAway()) toolTip[0].append(" is away");
if(!_ircUser->awayMessage().isEmpty()) toolTip[0].append(QString(" (%1)").arg(_ircUser->awayMessage()));
if(!_ircUser->realName().isEmpty()) toolTip.append(_ircUser->realName());
- if(!_ircUser->ircOperator().isEmpty()) toolTip.append(_ircUser->ircOperator());
+ if(!_ircUser->ircOperator().isEmpty()) toolTip.append(QString("%1 %2").arg(nickName()).arg(_ircUser->ircOperator()));
+ if(!_ircUser->suserHost().isEmpty()) toolTip.append(_ircUser->suserHost());
+ if(!_ircUser->whoisServiceReply().isEmpty()) toolTip.append(_ircUser->whoisServiceReply());
+
toolTip.append(_ircUser->hostmask().remove(0, _ircUser->hostmask().indexOf("!")+1));
if(_ircUser->idleTime().isValid()) {
toolTip.append(_ircUser->hostmask().remove(0, _ircUser->hostmask().indexOf("!")+1));
if(_ircUser->idleTime().isValid()) {