projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b921583
)
Fixed URL recognizer to not endlessly loop anymore
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Wed, 6 Aug 2008 14:59:45 +0000
(16:59 +0200)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Wed, 6 Aug 2008 14:59:45 +0000
(16:59 +0200)
src/qtui/chatitem.cpp
patch
|
blob
|
history
diff --git
a/src/qtui/chatitem.cpp
b/src/qtui/chatitem.cpp
index
d58c6bc
..
14fd3ad
100644
(file)
--- a/
src/qtui/chatitem.cpp
+++ b/
src/qtui/chatitem.cpp
@@
-248,7
+248,7
@@
void ChatItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
void ChatItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
// FIXME dirty and fast hack to make http:// urls klickable
void ChatItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
// FIXME dirty and fast hack to make http:// urls klickable
- QRegExp regex("\\b(
(?:h|f)
t{1,2}ps?://[^\\s]+)\\b");
+ QRegExp regex("\\b(
[hf]
t{1,2}ps?://[^\\s]+)\\b");
QString str = data(ChatLineModel::DisplayRole).toString();
int idx = posToCursor(event->pos());
int mi = 0;
QString str = data(ChatLineModel::DisplayRole).toString();
int idx = posToCursor(event->pos());
int mi = 0;
@@
-259,6
+259,7
@@
void ChatItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
QDesktopServices::openUrl(QUrl(regex.capturedTexts()[1]));
break;
}
QDesktopServices::openUrl(QUrl(regex.capturedTexts()[1]));
break;
}
+ mi += regex.matchedLength();
} while(mi >= 0);
event->accept();
}
} while(mi >= 0);
event->accept();
}