[empathy] Allow to remove contact from the 'Ungrouped' group using DnD
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Allow to remove contact from the 'Ungrouped' group using DnD
- Date: Mon, 15 Mar 2010 08:31:56 +0000 (UTC)
commit 91c1a372d9b58a42fd57cc4ce98888771b273f8d
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Wed Mar 10 14:19:25 2010 +0100
Allow to remove contact from the 'Ungrouped' group using DnD
libempathy-gtk/empathy-contact-list-view.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index b11a20e..b7e73f2 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. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]