| Summary: | do not highlight short channel names like #6 or #x | ||
|---|---|---|---|
| Product: | [Applications] konversation | Reporter: | Stanislav Karchebny <berk> |
| Component: | general | Assignee: | Konversation Bugs <konversation-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Stanislav Karchebny
2005-02-05 22:22:37 UTC
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; } } |