X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=14fd3addb049f37bcca246496f950a9dc78f2291;hp=d58c6bcf16d8ad24a1fcb63624ee73ed86a358bd;hb=f5f53f6c963f376b3003582f22314d744d157229;hpb=b921583e4d23f8890538814240788b4d3045b5ff 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(); }