]> git.0d.be Git - empathy.git/commitdiff
add 'Ungrouped' fake contact
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 9 Mar 2010 12:56:06 +0000 (13:56 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 15 Mar 2010 08:28:41 +0000 (09:28 +0100)
libempathy-gtk/empathy-contact-list-store.c
libempathy-gtk/empathy-contact-list-store.h

index 38fbfa5c586a47305dd5df09577f3e3bbbe21a40..ccca221d96eb947c1d124826b414e6579d096200 100644 (file)
@@ -28,6 +28,7 @@
 #include <string.h>
 
 #include <glib.h>
+#include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
 
 #include <telepathy-glib/util.h>
@@ -1044,8 +1045,18 @@ contact_list_store_add_contact (EmpathyContactListStore *store,
                flags = empathy_contact_manager_get_flags_for_connection (
                        EMPATHY_CONTACT_MANAGER (priv->list), connection);
        }
-       /* If no groups just add it at the top level. */
        if (!groups) {
+#if HAVE_FAVOURITE_CONTACTS
+               GtkTreeIter iter_group;
+
+               contact_list_store_get_group (store, EMPATHY_CONTACT_LIST_STORE_UNGROUPED,
+                       &iter_group, NULL, NULL);
+
+               gtk_tree_store_insert_after (GTK_TREE_STORE (store), &iter,
+                                            &iter_group, NULL);
+#else
+               /* FIXME: remove this in 2.31.x */
+               /* If no groups just add it at the top level. */
                GtkTreeModel *model = GTK_TREE_MODEL (store);
 
                if (gtk_tree_model_get_iter_first (model, &iter)) do {
@@ -1064,6 +1075,8 @@ contact_list_store_add_contact (EmpathyContactListStore *store,
                } while (gtk_tree_model_iter_next (model, &iter));
 
                gtk_tree_store_append (GTK_TREE_STORE (store), &iter, NULL);
+#endif
+
                gtk_tree_store_set (GTK_TREE_STORE (store), &iter,
                                    EMPATHY_CONTACT_LIST_STORE_COL_NAME, empathy_contact_get_name (contact),
                                    EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, contact,
index b852a1ba87b7d2b3eecbc10d156a32329b5ed227..75efa71a07a1e11d87a47a0015cb31a762443d0d 100644 (file)
@@ -67,6 +67,8 @@ typedef enum {
        EMPATHY_CONTACT_LIST_STORE_COL_COUNT,
 } EmpathyContactListStoreCol;
 
+#define EMPATHY_CONTACT_LIST_STORE_UNGROUPED _("Ungrouped")
+
 struct _EmpathyContactListStore {
        GtkTreeStore parent;
        gpointer priv;