aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-10 21:19:58 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-15 16:28:43 +0800
commit8af9b4b15e86ed2d7307977ca1d2708d894baaf0 (patch)
tree4f238584739f7664b6a281ee46f10654dbd0c551
parent91c1a372d9b58a42fd57cc4ce98888771b273f8d (diff)
downloadgsoc2013-empathy-8af9b4b15e86ed2d7307977ca1d2708d894baaf0.tar
gsoc2013-empathy-8af9b4b15e86ed2d7307977ca1d2708d894baaf0.tar.gz
gsoc2013-empathy-8af9b4b15e86ed2d7307977ca1d2708d894baaf0.tar.bz2
gsoc2013-empathy-8af9b4b15e86ed2d7307977ca1d2708d894baaf0.tar.lz
gsoc2013-empathy-8af9b4b15e86ed2d7307977ca1d2708d894baaf0.tar.xz
gsoc2013-empathy-8af9b4b15e86ed2d7307977ca1d2708d894baaf0.tar.zst
gsoc2013-empathy-8af9b4b15e86ed2d7307977ca1d2708d894baaf0.zip
Allow to unmark contacts as favorite using DnD
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index b7e73f21e..58d4569fc 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -245,6 +245,14 @@ contact_list_view_drag_got_contact (EmpathyTpContactFactory *factory,
return;
}
+ if (!tp_strdiff (data->old_group, EMPATHY_CONTACT_LIST_STORE_FAVORITE)) {
+ /* Remove contact as favourite */
+ empathy_contact_list_remove_from_favourites (list, contact);
+ /* Don't try to remove it */
+ g_free (data->old_group);
+ data->old_group = NULL;
+ }
+
if (data->new_group) {
empathy_contact_list_add_to_group (list, contact, data->new_group);
}
@@ -294,7 +302,7 @@ contact_list_view_contact_drag_received (GtkWidget *view,
gchar *new_group = NULL;
gchar *old_group = NULL;
gboolean success = TRUE;
- gboolean new_group_is_fake;
+ gboolean new_group_is_fake, old_group_is_fake = TRUE;
priv = GET_PRIV (view);
@@ -310,11 +318,14 @@ contact_list_view_contact_drag_received (GtkWidget *view,
source_path = gtk_tree_row_reference_get_path (priv->drag_row);
if (source_path) {
old_group = empathy_contact_list_store_get_parent_group (
- model, source_path, NULL, NULL);
+ model, source_path, NULL, &old_group_is_fake);
gtk_tree_path_free (source_path);
}
}
+ if (!group_can_be_modified (old_group, old_group_is_fake, FALSE))
+ return FALSE;
+
if (!tp_strdiff (old_group, new_group)) {
g_free (new_group);
g_free (old_group);