Bug 174262 - emoticon matching needs to be greedy
Summary: emoticon matching needs to be greedy
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 118624 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-04 15:32 UTC by Martin Matusiak
Modified: 2009-04-06 23:31 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
nongreedy matching of emoticons (39.21 KB, image/png)
2008-11-04 15:37 UTC, Martin Matusiak
Details
Makes emoticon parsing check largest emoticons first by sorting them (1.50 KB, patch)
2009-01-07 20:26 UTC, Timothy Knoll
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Matusiak 2008-11-04 15:32:54 UTC
Version:            (using KDE 4.1.2)
Installed from:    Ubuntu Packages

See this bug: https://bugs.kde.org/show_bug.cgi?id=133995

You've managed to reintroduce this again in kde4. The patch I wrote last time didn't touch the parser at all, it just sorted the strings by length before matching, so the longest string would be matched first, that way matching would always be greedy.
Comment 1 Martin Matusiak 2008-11-04 15:37:19 UTC
Created attachment 28323 [details]
nongreedy matching of emoticons
Comment 2 Timothy Knoll 2008-12-31 07:37:26 UTC
This is actually a kdelibs issue not a kopete issue.  The kopete team seems to ignore these bugs.  Try to reassign it.
Comment 3 Martin Matusiak 2008-12-31 15:45:04 UTC
Trying to reassign.
Comment 4 Timothy Knoll 2009-01-07 20:26:06 UTC
Created attachment 30015 [details]
Makes emoticon parsing check largest emoticons first by sorting them

If emoticons.xml is laid out in such a manner that the largest emoticons come first, the patch is unneeded.  However, having to sort emoticons.xml is pointless and should be handled in the code.  This makes it easier to port other emoticon sets to KDE and kopete
Comment 5 Timothy Knoll 2009-02-09 21:51:18 UTC
The patch will no longer be maintained.
Comment 6 Matt Rogers 2009-03-27 04:28:13 UTC
ok, i'm a bit confused by what the actual problem is. Should we be sorting the emoticons? Should the matching be non-greedy? greedy? I'm happy to fix this bug, but I need more information to determine the proper fix. Thanks.
Comment 7 Timothy Knoll 2009-03-27 04:35:58 UTC
Simply the issue is that it since its not greedy it doesn't recognize emoticons correctly.
If :- is in the list before :-) is it will display the emoticon for :- when :-) is typed.
One can overcome this by sorting the emoticon list by size in descending order when the list is loaded.
There are several other complaints about this. the filers just didn't know what was happening.
FYI the patch worked up through 4.2, it just needs cleaned up to fit the KDE style.
Comment 8 Matt Rogers 2009-04-01 05:28:02 UTC
SVN commit 947655 by mattr:

Fix bug 174262. Sort emoticons when tokenizing so the matching
works better than when the list is unsorted. 

Patch by Timothy Knoll. Thanks!
CCBUG: 174262



 M  +16 -0     kemoticonstheme.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=947655
Comment 9 Matt Rogers 2009-04-01 05:30:27 UTC
SVN commit 947656 by mattr:

Backport patch for bug 174262.
This should be in KDE starting with KDE 4.2.3

BUG: 174262


 M  +16 -0     kemoticonstheme.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=947656
Comment 10 Timothy Knoll 2009-04-06 20:58:26 UTC
bug 118624 is a duplicate.
Comment 11 Matt Rogers 2009-04-06 23:31:42 UTC
*** Bug 118624 has been marked as a duplicate of this bug. ***