projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b583497
)
Improve channelname recognition a bit (don't make #123 clickable)
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Fri, 2 Jan 2009 18:35:57 +0000
(19:35 +0100)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Fri, 2 Jan 2009 18:35:57 +0000
(19:35 +0100)
src/qtui/chatitem.cpp
patch
|
blob
|
history
diff --git
a/src/qtui/chatitem.cpp
b/src/qtui/chatitem.cpp
index
7e6d0e1
..
b72b8ad
100644
(file)
--- a/
src/qtui/chatitem.cpp
+++ b/
src/qtui/chatitem.cpp
@@
-571,11
+571,14
@@
void ContentsChatItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
onClickable = true;
showWebPreview(click);
} else if(click.type == Clickable::Channel) {
onClickable = true;
showWebPreview(click);
} else if(click.type == Clickable::Channel) {
- // don't make clickable if it's our own name
QString name = data(ChatLineModel::DisplayRole).toString().mid(click.start, click.length);
QString name = data(ChatLineModel::DisplayRole).toString().mid(click.start, click.length);
- BufferId myId = data(MessageModel::BufferIdRole).value<BufferId>();
- if(Client::networkModel()->bufferName(myId) != name)
- onClickable = true;
+ // don't make clickable if it could be a #number
+ if(!QRegExp("^#\\d+$").exactMatch(name)) {
+ // don't make clickable if it's our own name
+ BufferId myId = data(MessageModel::BufferIdRole).value<BufferId>();
+ if(Client::networkModel()->bufferName(myId) != name)
+ onClickable = true;
+ }
}
if(onClickable) {
setCursor(Qt::PointingHandCursor);
}
if(onClickable) {
setCursor(Qt::PointingHandCursor);