X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatwidget.cpp;h=f386b8e29c469468267e778f1baf7190a6de76a4;hb=fadb23192f41a04c6a8e16e69576c675a8c40c0a;hp=131caa429561f625c27eccce6d4b8ad7bfb8287d;hpb=2684aa5295d12e4f7c66b3011fc8b1819f3d1cbb;p=quassel.git diff --git a/src/qtui/chatwidget.cpp b/src/qtui/chatwidget.cpp index 131caa42..f386b8e2 100644 --- a/src/qtui/chatwidget.cpp +++ b/src/qtui/chatwidget.cpp @@ -384,7 +384,8 @@ void ChatWidget::mouseDoubleClickEvent(QMouseEvent *event) { len = end - start; } QString word = text.mid(start, len); - if(word.startsWith("http://")) { + QRegExp regex("^(h|f)t{1,2}ps?:\\/\\/"); + if(regex.indexIn(word) != -1) { QDesktopServices::openUrl(QUrl(word)); } @@ -410,7 +411,11 @@ void ChatWidget::mouseReleaseEvent(QMouseEvent *event) { selectionStart = qMin(dragStartCursor, curCursor); selectionEnd = qMax(dragStartCursor, curCursor); // TODO Make X11SelectionMode configurable! +#ifdef Q_WS_X11 + QApplication::clipboard()->setText(selectionToString(), QClipboard::Selection); +#else QApplication::clipboard()->setText(selectionToString()); +#endif break; case MarkLines: mouseMode = Normal; @@ -418,7 +423,11 @@ void ChatWidget::mouseReleaseEvent(QMouseEvent *event) { selectionStart = qMin(dragStartLine, curLine); selectionEnd = qMax(dragStartLine, curLine); // TODO Make X11SelectionMode configurable! +#ifdef Q_WS_X11 + QApplication::clipboard()->setText(selectionToString(), QClipboard::Selection); +#else QApplication::clipboard()->setText(selectionToString()); +#endif break; default: mouseMode = Normal;