X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatwidget.cpp;h=cf897b6ff42c9efa06329c26bf012ecc92fd7511;hb=a452f552e43af755fa0dc854f7fc11d3977f6e9a;hp=131caa429561f625c27eccce6d4b8ad7bfb8287d;hpb=2684aa5295d12e4f7c66b3011fc8b1819f3d1cbb;p=quassel.git diff --git a/src/qtui/chatwidget.cpp b/src/qtui/chatwidget.cpp index 131caa42..cf897b6f 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,12 @@ 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); +#endif +//#else QApplication::clipboard()->setText(selectionToString()); +//#endif break; default: mouseMode = Normal; @@ -619,7 +629,7 @@ void ChatWidget::viewportChanged(int newPos) { if(buffer->contents().isEmpty()) return; MsgId msgId = buffer->contents().first()->msgId(); - if(!lastBacklogOffset.isValid() || msgId < lastBacklogOffset && lastBacklogSize + REQUEST_COUNT <= buffer->contents().count()) { + if(!lastBacklogOffset.isValid() || (msgId < lastBacklogOffset && lastBacklogSize + REQUEST_COUNT <= buffer->contents().count())) { Client::backlogManager()->requestBacklog(bufferId, REQUEST_COUNT, msgId.toInt()); lastBacklogOffset = msgId; lastBacklogSize = buffer->contents().size();