diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-03-10 20:26:50 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-03-15 16:28:42 +0800 |
commit | 3cab7c229b83bd9668c45a60d562a2e2574dfc49 (patch) | |
tree | cc0762fa5c7b798f9f8d870e1a30fac045f33eaa /libempathy-gtk | |
parent | 8ae91c9509dde4dea0bc735dd24c7e3a690b4c9a (diff) | |
download | gsoc2013-empathy-3cab7c229b83bd9668c45a60d562a2e2574dfc49.tar gsoc2013-empathy-3cab7c229b83bd9668c45a60d562a2e2574dfc49.tar.gz gsoc2013-empathy-3cab7c229b83bd9668c45a60d562a2e2574dfc49.tar.bz2 gsoc2013-empathy-3cab7c229b83bd9668c45a60d562a2e2574dfc49.tar.lz gsoc2013-empathy-3cab7c229b83bd9668c45a60d562a2e2574dfc49.tar.xz gsoc2013-empathy-3cab7c229b83bd9668c45a60d562a2e2574dfc49.tar.zst gsoc2013-empathy-3cab7c229b83bd9668c45a60d562a2e2574dfc49.zip |
Support to tag contact as favorite using DnD
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | 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 e5638954f..941207912 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. */ |