Version: 0.16 #2075 (using KDE Devel) Installed from: Compiled sources Compiler: gcc 3.4 OS: Linux as these channel names are uncommon and are usually not meant as channel names at all, maybe limit length to up to two characters (#ab #66 as examples). highlighting them is a bit misleading, since such channels are less possible to exist and joining them by typing their names is quick too.
CVS commit by cartman: Omit single character channel names when building channel links BUG:98647 M +6 -7 common.cpp 1.32 --- kdeextragear-2/konversation/konversation/common.cpp #1.31:1.32 @@ -51,5 +51,5 @@ QString tagURLs(const QString& text, con if(filteredLine.contains("#")) { - QRegExp chanExp("(?:^|\\s)#[^\\s\\x0007,]+"); + QRegExp chanExp("(?:^|\\s)#[^\\s\\x0007,]{2,}"); while((pos = chanExp.search(filteredLine, pos)) >= 0)
commit 928daff0e138bdc792463bcea526a7b7b425fb13 Author: İsmail Dönmez <ismail@kde.org> Date: Sat Feb 5 22:44:01 2005 +0000 Omit single character channel names when building channel links BUG:98647 svn path=/trunk/kdeextragear-2/konversation/; revision=386565 diff --git a/konversation/common.cpp b/konversation/common.cpp index 80b1d79..08dfb4d 100644 --- a/konversation/common.cpp +++ b/konversation/common.cpp @@ -50,17 +50,16 @@ QString tagURLs(const QString& text, const QString& fromNick) if(filteredLine.contains("#")) { - QRegExp chanExp("(?:^|\\s)#[^\\s\\x0007,]+"); + QRegExp chanExp("(?:^|\\s)#[^\\s\\x0007,]{2,}"); while((pos = chanExp.search(filteredLine, pos)) >= 0) { urlLen = chanExp.matchedLength(); - QString href = filteredLine.mid( pos, urlLen ); - QString link = "#" + href.stripWhiteSpace(); - - link = "<font color=\"#"+linkColor+"\"><a href=\""+link+"\">"+href+"</a></font>"; - filteredLine.replace( pos, urlLen, link ); - pos += link.length()-1; + QString href = filteredLine.mid( pos, urlLen ); + QString link = "#" + href.stripWhiteSpace(); + link = "<font color=\"#"+linkColor+"\"><a href=\""+link+"\">"+href+"</a></font>"; + filteredLine.replace( pos, urlLen, link ); + pos += link.length()-1; } }