[empathy] Support to tag contact as favorite using DnD



commit 3cab7c229b83bd9668c45a60d562a2e2574dfc49
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Mar 10 13:26:50 2010 +0100

    Support to tag contact as favorite using DnD

 libempathy-gtk/empathy-contact-list-view.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index e563895..9412079 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -238,6 +238,13 @@ contact_list_view_drag_got_contact (EmpathyTpContactFactory *factory,
 		data->old_group, data->new_group);
 
 	list = empathy_contact_list_store_get_list_iface (priv->store);
+
+	if (!tp_strdiff (data->new_group, EMPATHY_CONTACT_LIST_STORE_FAVORITE)) {
+		/* Mark contact as favourite */
+		empathy_contact_list_add_to_favourites (list, contact);
+		return;
+	}
+
 	if (data->new_group) {
 		empathy_contact_list_add_to_group (list, contact, data->new_group);
 	}
@@ -274,8 +281,10 @@ contact_list_view_contact_drag_received (GtkWidget         *view,
 	new_group = empathy_contact_list_store_get_parent_group (model,
 								 path, NULL, &is_fake_group);
 
-	if (is_fake_group)
-		/* Fake groups can't be modified */
+	if (is_fake_group &&
+			tp_strdiff (new_group, EMPATHY_CONTACT_LIST_STORE_FAVORITE))
+		/* Fake groups can't be modified. We allow to drag to the favorite fake
+		 * group tough so user can mark contact as favorite using DnD */
 		return FALSE;
 
 	/* Get source group information. */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]