aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-09 21:53:53 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-15 16:28:41 +0800
commit1accacab8c375482d6bd16de400529e333c8078f (patch)
tree65a7c5d7cdcb1c4208199beb4f7127407280adfc /libempathy-gtk
parenta15866686e0851f4951144f0d7a6118e963b605d (diff)
downloadgsoc2013-empathy-1accacab8c375482d6bd16de400529e333c8078f.tar
gsoc2013-empathy-1accacab8c375482d6bd16de400529e333c8078f.tar.gz
gsoc2013-empathy-1accacab8c375482d6bd16de400529e333c8078f.tar.bz2
gsoc2013-empathy-1accacab8c375482d6bd16de400529e333c8078f.tar.lz
gsoc2013-empathy-1accacab8c375482d6bd16de400529e333c8078f.tar.xz
gsoc2013-empathy-1accacab8c375482d6bd16de400529e333c8078f.tar.zst
gsoc2013-empathy-1accacab8c375482d6bd16de400529e333c8078f.zip
Create a fake 'Favorites People' group
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-list-store.c19
-rw-r--r--libempathy-gtk/empathy-contact-list-store.h1
2 files changed, 19 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index 21593932f..b322ed7c1 100644
--- a/libempathy-gtk/empathy-contact-list-store.c
+++ b/libempathy-gtk/empathy-contact-list-store.c
@@ -965,6 +965,9 @@ contact_list_store_favourites_changed_cb (EmpathyContactList *list_iface,
contact_list_store_change_contact_favourite_status (store, contact,
is_favourite);
+
+ contact_list_store_remove_contact (store, contact);
+ contact_list_store_add_contact (store, contact);
}
static void
@@ -1115,8 +1118,22 @@ contact_list_store_add_contact (EmpathyContactListStore *store,
}
g_list_free (groups);
- contact_list_store_contact_update (store, contact);
+#ifdef HAVE_FAVOURITE_CONTACTS
+ if (empathy_contact_list_is_favourite (priv->list, contact)) {
+ /* Add contact to the fake 'Favorites' group */
+ GtkTreeIter iter_group;
+
+ contact_list_store_get_group (store, EMPATHY_CONTACT_LIST_STORE_FAVORITE,
+ &iter_group, NULL, NULL);
+ gtk_tree_store_insert_after (GTK_TREE_STORE (store), &iter,
+ &iter_group, NULL);
+
+ add_contact_to_store (GTK_TREE_STORE (store), &iter, contact, flags);
+ }
+#endif
+
+ contact_list_store_contact_update (store, contact);
}
static void
diff --git a/libempathy-gtk/empathy-contact-list-store.h b/libempathy-gtk/empathy-contact-list-store.h
index 75efa71a0..144113cc1 100644
--- a/libempathy-gtk/empathy-contact-list-store.h
+++ b/libempathy-gtk/empathy-contact-list-store.h
@@ -68,6 +68,7 @@ typedef enum {
} EmpathyContactListStoreCol;
#define EMPATHY_CONTACT_LIST_STORE_UNGROUPED _("Ungrouped")
+#define EMPATHY_CONTACT_LIST_STORE_FAVORITE _("Favorites People")
struct _EmpathyContactListStore {
GtkTreeStore parent;