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

List:       kopete-devel
Subject:    [kopete-devel] my first bugfix :)
From:       Chani <chani () aebc ! com>
Date:       2005-06-02 8:27:18
Message-ID: 200506020127.36429.chani () aebc ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


err... I fixed a minor bug with emoticons. they were showing up nearly 
everywhere except people's names in chatwindows, and it really bugs me... as 
far as I can tell, the code that was supposed to add them was actually 
removing them.
things were even weirder in status messages when someone changed their name- 
sometimes they would show up and sometimes they wouldn't.
I think I've fixed both those problems, although I'm not quite certain about 
the status messages. they might just be pretending to be fixed... :)
changing the style was also making strange changes to which emoticons showed 
up, which might just be part of the same bug, becuse it's not happening right 
now either.

anyways, I was told to send the output of svn diff to this mailing list.. 
so... here it is...

Index: chatmessagepart.cpp
===================================================================
--- chatmessagepart.cpp (revision 421045)
+++ chatmessagepart.cpp (working copy)
@@ -402,11 +402,13 @@

                if ( nick != parsed_nick )
                {
+                       //parse emoticons in the nick
                        retVal.replace( QRegExp( QString::fromLatin1
("([\\s&;>])%1([\\s&;<:])")
-                                       .arg( QRegExp::escape( parsed_nick ) )  ), 
QString::fromLatin1("\\1%1\\2").arg( nick ) );
+                                       .arg( QRegExp::escape( nick ) )  ), 
QString::fromLatin1("\\1%1\\2").arg( parsed_nick ) );
                }
                if ( nick.length() > 0 && ( retVal.find( nick ) > -1 ) )
                {
+                       //add link to this nick
                        retVal.replace(
                                QRegExp( QString::fromLatin1("([\\s&;>])(%1)
([\\s&;<:])")
                                        .arg( QRegExp::escape( nick ) )  ),
@@ -415,9 +417,10 @@
                        );
                }
        }
+       //parse emoticons in your own nick
        QString nick = 
m_manager->myself()->property( Kopete::Global::Properties::self()->nickName().key() ).value().toString();
        retVal.replace( QRegExp( QString::fromLatin1("([\\s&;>])%1
([\\s&;<:])")
-                       .arg( QRegExp::escape( Kopete::Emoticons::parseEmoticons( nick ) ) )  ), 
QString::fromLatin1("\\1%1\\2").arg( nick ) );
+                       .arg( QRegExp::escape( nick ) )  ), 
QString::fromLatin1
("\\1%1\\2").arg( Kopete::Emoticons::parseEmoticons( nick )) );

        return retVal;
 }


-- 
This insane ranting was brought to you by evyl bananas, and the number 3.
Blaa! 8-)
www.chani3.com

[Attachment #5 (application/pgp-signature)]

_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel


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

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