X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=14fd3addb049f37bcca246496f950a9dc78f2291;hb=31253a98ef87edb8f87ff53270529ed4f7659612;hp=d58c6bcf16d8ad24a1fcb63624ee73ed86a358bd;hpb=ba9de06a8634a30863d54001cb8f934746333d58;p=quassel.git diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index d58c6bcf..14fd3add 100644 --- 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 - 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; @@ -259,6 +259,7 @@ void ChatItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { QDesktopServices::openUrl(QUrl(regex.capturedTexts()[1])); break; } + mi += regex.matchedLength(); } while(mi >= 0); event->accept(); }