[Konversation-devel] [Bug 153101] using 'amp' as nickname causes unexpected highlights

Peter Simonsson peter.simonsson at gmail.com
Sun Dec 19 20:22:05 CET 2010


https://bugs.kde.org/show_bug.cgi?id=153101


Peter Simonsson <peter.simonsson at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #2 from Peter Simonsson <peter simonsson gmail com>  2010-12-19 20:22:04 ---
commit de3a1926d95012619317f88e8a25cf165d4c5849
branch master
Author: Peter Simonsson <peter.simonsson at gmail.com>
Date:   Sun Dec 19 20:20:59 2010 +0100

    Use original line when looking for highlights in filter

    Using the original line when looking for highlights avoids running into
    trouble with html formating interfering with the highlights

    BUG:153101

diff --git a/src/viewer/ircview.cpp b/src/viewer/ircview.cpp
index 6c91060..25f661e 100644
--- a/src/viewer/ircview.cpp
+++ b/src/viewer/ircview.cpp
@@ -996,7 +996,7 @@ bool doHighlight, bool parseURL, bool self,
QChar::Direction* direction)
         QString highlightColor;

         if(Preferences::self()->highlightNick() &&
-            filteredLine.toLower().contains(QRegExp("(^|[^\\d\\w])" +
+            line.toLower().contains(QRegExp("(^|[^\\d\\w])" +
             QRegExp::escape(ownNick.toLower()) +
             "([^\\d\\w]|$)")))
         {
@@ -1020,7 +1020,7 @@ bool doHighlight, bool parseURL, bool self,
QChar::Direction* direction)
                     QRegExp needleReg(highlight->getPattern());
                     needleReg.setCaseSensitivity(Qt::CaseInsensitive);
                                                   // highlight regexp in text
-                    patternFound = ((filteredLine.contains(needleReg)) ||
+                    patternFound = ((line.contains(needleReg)) ||
                                                   // highlight regexp in
nickname
                         (whoSent.contains(needleReg)));

@@ -1032,7 +1032,7 @@ bool doHighlight, bool parseURL, bool self,
QChar::Direction* direction)
                 {
                     QString needle=highlight->getPattern();
                                                   // highlight patterns in
text
-                    patternFound = ((filteredLine.contains(needle,
Qt::CaseInsensitive)) ||
+                    patternFound = ((line.contains(needle,
Qt::CaseInsensitive)) ||
                                                   // highlight patterns in
nickname
                         (whoSent.contains(needle, Qt::CaseInsensitive)));
                 }

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Konversation-devel mailing list