[gtk+] ComboBox: Remove pointless signal ID member fields
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] ComboBox: Remove pointless signal ID member fields
- Date: Fri, 1 Sep 2017 15:36:33 +0000 (UTC)
commit 9a6adcbce4680fe2c59bcbfecabbc9e40afa173e
Author: Daniel Boles <dboles src gnome org>
Date: Fri Sep 1 11:52:12 2017 +0100
ComboBox: Remove pointless signal ID member fields
We don’t need to store these for disconnection, as we can just use
g_signal_handlers_disconnect_by_data().
gtk/gtkcombobox.c | 41 +++++++++++++----------------------------
1 files changed, 13 insertions(+), 28 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 474eb21..5e59260 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -138,10 +138,6 @@ struct _GtkComboBoxPrivate
GtkWidget *popup_widget;
- gulong inserted_id;
- gulong deleted_id;
- gulong reordered_id;
- gulong changed_id;
guint popup_idle_id;
guint scroll_timer;
guint resize_idle_id;
@@ -1620,14 +1616,7 @@ gtk_combo_box_unset_model (GtkComboBox *combo_box)
if (priv->model)
{
- g_signal_handler_disconnect (priv->model,
- priv->inserted_id);
- g_signal_handler_disconnect (priv->model,
- priv->deleted_id);
- g_signal_handler_disconnect (priv->model,
- priv->reordered_id);
- g_signal_handler_disconnect (priv->model,
- priv->changed_id);
+ g_signal_handlers_disconnect_by_data (priv->model, combo_box);
g_object_unref (priv->model);
priv->model = NULL;
@@ -2469,22 +2458,18 @@ gtk_combo_box_set_model (GtkComboBox *combo_box,
priv->model = model;
g_object_ref (priv->model);
- priv->inserted_id =
- g_signal_connect (priv->model, "row-inserted",
- G_CALLBACK (gtk_combo_box_model_row_inserted),
- combo_box);
- priv->deleted_id =
- g_signal_connect (priv->model, "row-deleted",
- G_CALLBACK (gtk_combo_box_model_row_deleted),
- combo_box);
- priv->reordered_id =
- g_signal_connect (priv->model, "rows-reordered",
- G_CALLBACK (gtk_combo_box_model_rows_reordered),
- combo_box);
- priv->changed_id =
- g_signal_connect (priv->model, "row-changed",
- G_CALLBACK (gtk_combo_box_model_row_changed),
- combo_box);
+ g_signal_connect (priv->model, "row-inserted",
+ G_CALLBACK (gtk_combo_box_model_row_inserted),
+ combo_box);
+ g_signal_connect (priv->model, "row-deleted",
+ G_CALLBACK (gtk_combo_box_model_row_deleted),
+ combo_box);
+ g_signal_connect (priv->model, "rows-reordered",
+ G_CALLBACK (gtk_combo_box_model_rows_reordered),
+ combo_box);
+ g_signal_connect (priv->model, "row-changed",
+ G_CALLBACK (gtk_combo_box_model_row_changed),
+ combo_box);
_gtk_tree_menu_set_model (GTK_TREE_MENU (priv->popup_widget),
priv->model);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]