]> git.0d.be Git - empathy.git/commitdiff
Rely on compare_separator_and_groups when either A or B isn't a contact
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sat, 19 Jun 2010 19:38:03 +0000 (20:38 +0100)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sat, 19 Jun 2010 19:38:07 +0000 (20:38 +0100)
We can't rely on the fact that compare_separator_and_groups only returns
0 in the case it compares two contacts. But we can completely rely on its
result if we give it at least one non-contact.

libempathy-gtk/empathy-contact-list-store.c

index d5969c87beccebfbe54395374ac35510d7ac3868..de838441f8511f90c3d728952cf418669472a963 100644 (file)
@@ -1630,10 +1630,9 @@ contact_list_store_state_sort_func (GtkTreeModel *model,
                            EMPATHY_CONTACT_LIST_STORE_COL_IS_FAKE_GROUP, &fake_group_b,
                            -1);
 
-       ret_val = compare_separator_and_groups (is_separator_a, is_separator_b,
-               name_a, name_b, contact_a, contact_b, fake_group_a, fake_group_b);
-
-       if (ret_val != 0) {
+       if (contact_a == NULL || contact_b == NULL) {
+               ret_val = compare_separator_and_groups (is_separator_a, is_separator_b,
+                       name_a, name_b, contact_a, contact_b, fake_group_a, fake_group_b);
                goto free_and_out;
        }