diff options
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 16 | ||||
-rw-r--r-- | libempathy-gtk/empathy-chat.h | 3 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-list-store.c | 19 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-menu.c | 4 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-widget.c | 8 |
5 files changed, 19 insertions, 31 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 9e69c733a..52405ec47 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -63,7 +63,7 @@ #define COMPOSING_STOP_TIMEOUT 5 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChat) -typedef struct { +struct _EmpathyChatPriv { EmpathyTpChat *tp_chat; TpAccount *account; gchar *id; @@ -138,7 +138,7 @@ typedef struct { * notified again about the already notified pending messages when the * messages in tab will be properly shown */ gboolean retrieving_backlogs; -} EmpathyChatPriv; +}; typedef struct { gchar *text; /* Original message that was specified @@ -2420,18 +2420,18 @@ conf_spell_checking_cb (GSettings *gsettings_chat, } static gboolean -chat_hpaned_pos_changed_cb (GtkWidget* hpaned, gpointer user_data) +chat_hpaned_pos_changed_cb (GtkWidget* hpaned, + GParamSpec *spec, + gpointer user_data) { - GSettings *gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA); + EmpathyChat *chat = EMPATHY_CHAT (user_data); gint hpaned_pos; hpaned_pos = gtk_paned_get_position (GTK_PANED(hpaned)); - g_settings_set_int (gsettings_chat, + g_settings_set_int (chat->priv->gsettings_ui, EMPATHY_PREFS_UI_CHAT_WINDOW_PANED_POS, hpaned_pos); - g_object_unref (gsettings_chat); - return TRUE; } @@ -2529,7 +2529,7 @@ chat_create_ui (EmpathyChat *chat) g_signal_connect (priv->hpaned, "notify::position", G_CALLBACK (chat_hpaned_pos_changed_cb), - NULL); + chat); /* Load the paned position */ paned_pos = g_settings_get_int (priv->gsettings_ui, diff --git a/libempathy-gtk/empathy-chat.h b/libempathy-gtk/empathy-chat.h index 7f3ebda26..596b83f5d 100644 --- a/libempathy-gtk/empathy-chat.h +++ b/libempathy-gtk/empathy-chat.h @@ -47,10 +47,11 @@ G_BEGIN_DECLS typedef struct _EmpathyChat EmpathyChat; typedef struct _EmpathyChatClass EmpathyChatClass; +typedef struct _EmpathyChatPriv EmpathyChatPriv; struct _EmpathyChat { GtkBin parent; - gpointer priv; + EmpathyChatPriv *priv; /* Protected */ EmpathyChatView *view; diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index 57768997d..de838441f 100644 --- a/libempathy-gtk/empathy-contact-list-store.c +++ b/libempathy-gtk/empathy-contact-list-store.c @@ -1061,7 +1061,6 @@ contact_list_store_add_contact (EmpathyContactListStore *store, } g_list_free (groups); -#ifdef HAVE_FAVOURITE_CONTACTS if (priv->show_groups && empathy_contact_list_is_favourite (priv->list, contact)) { /* Add contact to the fake 'Favorites' group */ @@ -1072,7 +1071,6 @@ contact_list_store_add_contact (EmpathyContactListStore *store, add_contact_to_store (GTK_TREE_STORE (store), &iter, &iter_group, contact, flags); } -#endif contact_list_store_contact_update (store, contact); } @@ -1573,6 +1571,8 @@ contact_list_store_contact_sort (EmpathyContact *contact_a, TpAccount *account_a, *account_b; gint ret_val; + g_return_val_if_fail (contact_a != NULL || contact_b != NULL, 0); + /* alias */ ret_val = g_utf8_collate (empathy_contact_get_name (contact_a), empathy_contact_get_name (contact_b)); @@ -1630,10 +1630,9 @@ contact_list_store_state_sort_func (GtkTreeModel *model, EMPATHY_CONTACT_LIST_STORE_COL_IS_FAKE_GROUP, &fake_group_b, -1); - ret_val = compare_separator_and_groups (is_separator_a, is_separator_b, - name_a, name_b, contact_a, contact_b, fake_group_a, fake_group_b); - - if (ret_val != 0) { + if (contact_a == NULL || contact_b == NULL) { + ret_val = compare_separator_and_groups (is_separator_a, is_separator_b, + name_a, name_b, contact_a, contact_b, fake_group_a, fake_group_b); goto free_and_out; } @@ -1689,10 +1688,10 @@ contact_list_store_name_sort_func (GtkTreeModel *model, EMPATHY_CONTACT_LIST_STORE_COL_IS_FAKE_GROUP, &fake_group_b, -1); - ret_val = compare_separator_and_groups (is_separator_a, is_separator_b, - name_a, name_b, contact_a, contact_b, fake_group_a, fake_group_b); - - if (ret_val == 0) + if (contact_a == NULL || contact_b == NULL) + ret_val = compare_separator_and_groups (is_separator_a, is_separator_b, + name_a, name_b, contact_a, contact_b, fake_group_a, fake_group_b); + else ret_val = contact_list_store_contact_sort (contact_a, contact_b); if (contact_a) { diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index 9ea19af32..9b49389c1 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -131,14 +131,12 @@ empathy_contact_menu_new (EmpathyContact *contact, gtk_widget_show (item); } -#if HAVE_FAVOURITE_CONTACTS /* Favorite checkbox */ if (features & EMPATHY_CONTACT_FEATURE_FAVOURITE) { item = empathy_contact_favourite_menu_item_new (contact); gtk_menu_shell_append (shell, item); gtk_widget_show (item); } -#endif return menu; } @@ -392,7 +390,6 @@ empathy_contact_share_my_desktop_menu_item_new (EmpathyContact *contact) return item; } -#if HAVE_FAVOURITE_CONTACTS static void favourite_menu_item_toggled_cb (GtkCheckMenuItem *item, EmpathyContact *contact) @@ -432,7 +429,6 @@ empathy_contact_favourite_menu_item_new (EmpathyContact *contact) g_object_unref (manager); return item; } -#endif static void contact_info_menu_item_activate_cb (EmpathyContact *contact) diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 72fe321d7..e7a6b3a14 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -1405,7 +1405,6 @@ contact_widget_presence_notify_cb (EmpathyContactWidget *information) gtk_widget_show (information->image_state); } -#if HAVE_FAVOURITE_CONTACTS static void contact_widget_favourites_changed_cb (EmpathyContactManager *manager, EmpathyContact *contact, @@ -1418,7 +1417,6 @@ contact_widget_favourites_changed_cb (EmpathyContactManager *manager, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON ( information->favourite_checkbox), is_favourite); } -#endif static void contact_widget_remove_contact (EmpathyContactWidget *information) @@ -1524,7 +1522,6 @@ contact_widget_contact_update (EmpathyContactWidget *information) contact_widget_presence_notify_cb (information); contact_widget_avatar_notify_cb (information); -#if HAVE_FAVOURITE_CONTACTS if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_FAVOURITE) { gboolean is_favourite; @@ -1536,7 +1533,6 @@ contact_widget_contact_update (EmpathyContactWidget *information) contact_widget_favourites_changed_cb (information->manager, information->contact, is_favourite, information); } -#endif gtk_widget_show (information->label_alias); gtk_widget_show (information->widget_alias); @@ -1657,7 +1653,6 @@ contact_widget_id_focus_out_cb (GtkWidget *widget, return FALSE; } -#if HAVE_FAVOURITE_CONTACTS static void favourite_toggled_cb (GtkToggleButton *button, EmpathyContactWidget *information) @@ -1677,7 +1672,6 @@ favourite_toggled_cb (GtkToggleButton *button, EMPATHY_CONTACT_LIST (information->manager), information->contact); } } -#endif static void contact_widget_contact_setup (EmpathyContactWidget *information) @@ -1817,7 +1811,6 @@ contact_widget_contact_setup (EmpathyContactWidget *information) } gtk_widget_show (information->widget_alias); -#if HAVE_FAVOURITE_CONTACTS /* Favorite */ if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_FAVOURITE) { @@ -1836,7 +1829,6 @@ contact_widget_contact_setup (EmpathyContactWidget *information) gtk_widget_show (information->favourite_checkbox); } -#endif } static void |