[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeextragear-2/konversation/konversation
From:       İsmail Dönmez <ismail () kde ! org ! tr>
Date:       2005-04-08 13:13:37
Message-ID: 20050408131337.813D263E () office ! kde ! org
[Download RAW message or body]

CVS commit by cartman: 

Make *foo* bold and _bar_ underline like in KSirc
FEATURE:88786


  M +18 -0     ircview.cpp   1.249


--- kdeextragear-2/konversation/konversation/ircview.cpp  #1.248:1.249
@@ -261,4 +261,22 @@ QString IRCView::filter(const QString& l
     filteredLine.replace(">","&gt;");
 
+
+    QRegExp boldRe("\\*(\\w+)\\*");
+    QRegExp underRe("\\_(\\w+)\\_");
+    int position;
+    QString old,replacement;
+
+    position = boldRe.search(filteredLine);
+    old = boldRe.capturedTexts()[0];
+    replacement = "\x02"+boldRe.capturedTexts()[1]+"\x02";
+    filteredLine.replace(position,old.length(),replacement);
+
+    position = underRe.search(filteredLine);
+    old = underRe.capturedTexts()[0];
+    replacement = "\x1f"+underRe.capturedTexts()[1]+"\x1f";
+    filteredLine.replace(position,old.length(),replacement);
+    
+
+
     // Replace all 0x03 without color number (reset color) with \0x031,0 or \
                \0x030,1, depending on which one fits
     // with the users chosen colours, based on the relative brightness. TODO \
defaultColor needs explanation


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic