Emoticonslib moved to kdereview

Olivier Goffart ogoffart at kde.org
Wed May 14 20:43:40 BST 2008


Le mercredi 14 mai 2008, Carlo a écrit :
> On Wed, May 14, 2008 at 12:08 AM, Olivier Goffart <ogoffart at kde.org> wrote:

> >  - The only purpose of the KEmoticons object is the signal that could be
> > moved to KGlobalSettings or something similair.  All the other method are
> > static, and could be placed as static members in the KEmoticonTheme.
>
> it's not just a signal, there are other things like a cache for the
> emoticons theme already loaded

But thoses are internals details and could live in a private static strict, 
not exposed to the public API.

> >  - the Token struct should just contains the token type, the text, and
> > the path to the emoticon.  'emoticonPath' is maybe a better name.
> >  The HTML should not be part of the token itself. because if html is
> > used, then the parse function can be used.
>
> I've copied that straight from kopete :P

The Kopete::Emoticons was in the private API :-) 

>
> >  - Performence!!!  The original Kopete code did maintain an index of
> > emoticons by the first character of it.   Looking thought each emoticon
> > on each character of the message doesn't give acceptable performences.
> > (noticable when you have a big emoticon set, and you have a big text to
> > parse (eg. browsing the history)
>
> I tought that this wasn't really useful, I'll readd it

This was really usefull, emoticons was a very noticable source of slowness in 
Kopete when we had to parse a complete discution. 
Adding the index, caching the sizes of pixmaps, ...  made it much faster.

> >  - SkipHTML is meant only for tokenize function. It means that the input
> > string is in Html.  The parseEmoticon function should only accept html
> > (and it should be documented), and should ensure that skipHTML flag is in
> > use.
>
> I don't understand this problem

the parseEmoticons() function MUST be used with proper html code.
because the function add <img/> tag into the string. 
so you should add the  SkipHTML to the tokenizer flags in that function.

The tokenize function can be used when the text is not in HTML format 


> >  - What is the use case of the exclude parameter?
>
> for example in linklocator in kdepimlibs that's used by kmail, they
> want to exclude "(c)" "(C)" and some other strings

Well, that's because having such emoticons in the theme is just non-sense.


> >  - In which kde library do you plan to move those class?
> >  It make few sens to have them as a stand alone library? (Or does it?)
> >  It can't be moved into kdeui because it uses kio.
> >  Maybe in kio or kdeutils?
>
> inside kdelibs as standalone like knewstuff/phonon etc.. I can't think
> of any other solutions

Ok.  It's just that it's a very small set of class for a stand alone library .

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080514/03ab6b25/attachment.sig>


More information about the kde-core-devel mailing list