After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 658336 - History window "Who" list should sort alphabetically
History window "Who" list should sort alphabetically
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Archives
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-09-06 08:59 UTC by Jussi Kukkonen
Modified: 2011-09-08 11:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
log-window: sort "Who" list store alphabetically (4.92 KB, patch)
2011-09-06 09:11 UTC, Jussi Kukkonen
committed Details | Review

Description Jussi Kukkonen 2011-09-06 08:59:40 UTC
The "Who"-list in the new History window is sorted with "g_strcmp0 (contact_name)" which is not what we want in a lot of cases: As an example "Chris" becomes before "bob" because of the initial capital letter.

Will attach a patch.
Comment 1 Jussi Kukkonen 2011-09-06 09:11:27 UTC
Created attachment 195765 [details] [review]
log-window: sort "Who" list store alphabetically

This commit should fix things.

Some semi-related comments: 

* The gtk_list_store_set() code is in two almost identical places, I didn't refactor that here but it could be made into a function.

* Does GtkTreemodel suck or what? Having to allocate and free strings in a GtkTreeIterCompareFunc feels so wrong...
Comment 2 Emilio Pozuelo Monfort 2011-09-06 09:30:48 UTC
Comment on attachment 195765 [details] [review]
log-window: sort "Who" list store alphabetically

Looks good
Comment 3 Emilio Pozuelo Monfort 2011-09-06 09:31:59 UTC
(In reply to comment #1)
> * Does GtkTreemodel suck or what? Having to allocate and free strings in a
> GtkTreeIterCompareFunc feels so wrong...

Yes, gtk_tree_model_get() returns new refs for objects and new strings for strings.
Comment 4 Jussi Kukkonen 2011-09-06 09:59:49 UTC
(In reply to comment #3)
> Yes, gtk_tree_model_get() returns new refs for objects and new strings for
> strings.

Yeah, I was just whining about it: potentially thousands and thousands of string allocates and frees for absolutely no benefit to anyone...

Anyway, Thanks for the prompt review and the good work: the new history window has made Empathy a lot more useful for me.
Comment 5 Emilio Pozuelo Monfort 2011-09-08 11:53:22 UTC
Attachment 195765 [details] pushed as 777e9d3 - log-window: sort "Who" list store alphabetically