From 91c1a372d9b58a42fd57cc4ce98888771b273f8d Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 10 Mar 2010 14:19:25 +0100 Subject: Allow to remove contact from the 'Ungrouped' group using DnD --- libempathy-gtk/empathy-contact-list-view.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index b11a20e14..b7e73f21e 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -255,17 +255,22 @@ contact_list_view_drag_got_contact (EmpathyTpContactFactory *factory, static gboolean group_can_be_modified (const gchar *name, - gboolean is_fake_group) + gboolean is_fake_group, + gboolean adding) { /* Real groups can always be modified */ if (!is_fake_group) return TRUE; - /* Only the favorite fake group can be modified so users can + /* The favorite fake group can be modified so users can * add/remove favorites using DnD */ if (!tp_strdiff (name, EMPATHY_CONTACT_LIST_STORE_FAVORITE)) return TRUE; + /* We can remove contacts from the 'ungrouped' fake group */ + if (!adding && !tp_strdiff (name, EMPATHY_CONTACT_LIST_STORE_UNGROUPED)) + return TRUE; + return FALSE; } @@ -297,7 +302,7 @@ contact_list_view_contact_drag_received (GtkWidget *view, new_group = empathy_contact_list_store_get_parent_group (model, path, NULL, &new_group_is_fake); - if (!group_can_be_modified (new_group, new_group_is_fake)) + if (!group_can_be_modified (new_group, new_group_is_fake, TRUE)) return FALSE; /* Get source group information. */ -- cgit v1.2.3