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));
}
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;
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;
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();