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;