aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-09 20:56:06 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-15 16:28:41 +0800
commit256b001de17b36d197f21e202d82547510868a5b (patch)
tree6f3e163ea93d2f285f17e2e168f08682cf584d70
parent3e47aa6e9b32793d878488d0344afb0ba9c09f2e (diff)
downloadgsoc2013-empathy-256b001de17b36d197f21e202d82547510868a5b.tar
gsoc2013-empathy-256b001de17b36d197f21e202d82547510868a5b.tar.gz
gsoc2013-empathy-256b001de17b36d197f21e202d82547510868a5b.tar.bz2
gsoc2013-empathy-256b001de17b36d197f21e202d82547510868a5b.tar.lz
gsoc2013-empathy-256b001de17b36d197f21e202d82547510868a5b.tar.xz
gsoc2013-empathy-256b001de17b36d197f21e202d82547510868a5b.tar.zst
gsoc2013-empathy-256b001de17b36d197f21e202d82547510868a5b.zip
add 'Ungrouped' fake contact
-rw-r--r--libempathy-gtk/empathy-contact-list-store.c15
-rw-r--r--libempathy-gtk/empathy-contact-list-store.h2
2 files changed, 16 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index 38fbfa5c5..ccca221d9 100644
--- a/libempathy-gtk/empathy-contact-list-store.c
+++ b/libempathy-gtk/empathy-contact-list-store.c
@@ -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,
diff --git a/libempathy-gtk/empathy-contact-list-store.h b/libempathy-gtk/empathy-contact-list-store.h
index b852a1ba8..75efa71a0 100644
--- a/libempathy-gtk/empathy-contact-list-store.h
+++ b/libempathy-gtk/empathy-contact-list-store.h
@@ -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;