From: Manuel Nickschas Date: Thu, 26 Mar 2009 23:07:21 +0000 (+0100) Subject: Allow arbitrary protocols for URL detection X-Git-Tag: 0.5-rc1~243 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=b0238fe2f113dd23df01eeb0491f0afe39847994 Allow arbitrary protocols for URL detection Rather than hardcoding a selection of protocols, we now allow all of the form \w+:// (plus mailto:) - this should cover all that make sense. See also bug #641. --- diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index dd23c5cb..9c84249c 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -418,7 +418,7 @@ QList ContentsChatItem::findClickables() const { static QRegExp regExp[] = { // URL // QRegExp(QString("((?:https?://|s?ftp://|irc://|mailto:|www\\.)%1+|%1+\\.[a-z]{2,4}(?:?=/%1+|\\b))%2").arg(urlChars, urlEnd)), - QRegExp(QString("((?:(?:https?://|s?ftp://|irc://|gopher://|mailto:)|www)%1+)%2").arg(urlChars, urlEnd), Qt::CaseInsensitive), + QRegExp(QString("((?:(?:mailto:|\\w+://)|www)%1+)%2").arg(urlChars, urlEnd), Qt::CaseInsensitive), // Channel name // We don't match for channel names starting with + or &, because that gives us a lot of false positives.