From 66dbf2d87306d9ee4c5325c1c96628a70d8eac1a Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 12 Dec 2011 12:57:03 +0100 Subject: remove EMPATHY_CONTACT_WIDGET_EDIT_FAVOURITE It's not used any more and this code was the last one using the contact manager. https://bugzilla.gnome.org/show_bug.cgi?id=660547 --- libempathy-gtk/empathy-contact-widget.c | 69 --------------------------------- libempathy-gtk/empathy-contact-widget.h | 5 +-- 2 files changed, 2 insertions(+), 72 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 476fb6217..3a08b6f26 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -37,7 +37,6 @@ #include #include -#include #include #include #include @@ -81,7 +80,6 @@ typedef struct { - EmpathyContactManager *manager; EmpathyContact *contact; EmpathyContactWidgetFlags flags; guint widget_id_timeout; @@ -1335,19 +1333,6 @@ contact_widget_presence_notify_cb (EmpathyContactWidget *information) gtk_widget_show (information->image_state); } -static void -contact_widget_favourites_changed_cb (EmpathyContactManager *manager, - EmpathyContact *contact, - gboolean is_favourite, - EmpathyContactWidget *information) -{ - if (contact != information->contact) - return; - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON ( - information->favourite_checkbox), is_favourite); -} - static void contact_widget_remove_contact (EmpathyContactWidget *information) { @@ -1449,20 +1434,6 @@ contact_widget_contact_update (EmpathyContactWidget *information) contact_widget_presence_notify_cb (information); contact_widget_avatar_notify_cb (information); - if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_FAVOURITE) - { - FolksPersona *persona = empathy_contact_get_persona ( - information->contact); - - if (persona != NULL && FOLKS_IS_FAVOURITE_DETAILS (persona)) - { - gboolean is_favourite = folks_favourite_details_get_is_favourite ( - FOLKS_FAVOURITE_DETAILS (persona)); - contact_widget_favourites_changed_cb (information->manager, - information->contact, is_favourite, information); - } - } - gtk_widget_show (information->label_alias); gtk_widget_show (information->widget_alias); gtk_widget_show (information->hbox_presence); @@ -1582,20 +1553,6 @@ contact_widget_id_focus_out_cb (GtkWidget *widget, return FALSE; } -static void -favourite_toggled_cb (GtkToggleButton *button, - EmpathyContactWidget *information) -{ - FolksPersona *persona = empathy_contact_get_persona (information->contact); - - if (persona != NULL && FOLKS_IS_FAVOURITE_DETAILS (persona)) - { - gboolean active = gtk_toggle_button_get_active (button); - folks_favourite_details_set_is_favourite ( - FOLKS_FAVOURITE_DETAILS (persona), active); - } -} - static void contact_widget_contact_setup (EmpathyContactWidget *information) { @@ -1737,25 +1694,6 @@ contact_widget_contact_setup (EmpathyContactWidget *information) gtk_label_set_selectable (GTK_LABEL (information->label_status), FALSE); } gtk_widget_show (information->widget_alias); - - /* Favorite */ - if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_FAVOURITE) - { - information->favourite_checkbox = gtk_check_button_new_with_label ( - _("Favorite")); - - g_signal_connect (information->favourite_checkbox, "toggled", - G_CALLBACK (favourite_toggled_cb), information); - - gtk_grid_attach (GTK_GRID (information->grid_contact), - information->favourite_checkbox, 0, 3, 1, 1); - - information->fav_sig_id = g_signal_connect (information->manager, - "favourites-changed", - G_CALLBACK (contact_widget_favourites_changed_cb), information); - - gtk_widget_show (information->favourite_checkbox); - } } static void @@ -1769,11 +1707,6 @@ contact_widget_destroy_cb (GtkWidget *widget, g_source_remove (information->widget_id_timeout); } - if (information->fav_sig_id != 0) - g_signal_handler_disconnect (information->manager, information->fav_sig_id); - - g_object_unref (information->manager); - g_slice_free (EmpathyContactWidget, information); } @@ -1834,8 +1767,6 @@ empathy_contact_widget_new (EmpathyContact *contact, "EmpathyContactWidget", information); - information->manager = empathy_contact_manager_dup_singleton (); - /* Create widgets */ contact_widget_contact_setup (information); contact_widget_details_setup (information); diff --git a/libempathy-gtk/empathy-contact-widget.h b/libempathy-gtk/empathy-contact-widget.h index fb684a41b..e683b1afe 100644 --- a/libempathy-gtk/empathy-contact-widget.h +++ b/libempathy-gtk/empathy-contact-widget.h @@ -61,9 +61,8 @@ typedef enum EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP = 1 << 5, EMPATHY_CONTACT_WIDGET_SHOW_LOCATION = 1 << 6, EMPATHY_CONTACT_WIDGET_NO_SET_ALIAS = 1 << 7, - EMPATHY_CONTACT_WIDGET_EDIT_FAVOURITE = 1 << 8, - EMPATHY_CONTACT_WIDGET_SHOW_DETAILS = 1 << 9, - EMPATHY_CONTACT_WIDGET_EDIT_DETAILS = 1 << 10, + EMPATHY_CONTACT_WIDGET_SHOW_DETAILS = 1 << 8, + EMPATHY_CONTACT_WIDGET_EDIT_DETAILS = 1 << 9, } EmpathyContactWidgetFlags; GtkWidget * empathy_contact_widget_new (EmpathyContact *contact, -- cgit v1.2.3