[gnome-builder] color-picker: use g_signal_connect_object()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] color-picker: use g_signal_connect_object()
- Date: Mon, 18 Jul 2016 00:22:48 +0000 (UTC)
commit a8c2f5bb9f83c90bc9d3c0ce365f4214f304bfce
Author: Christian Hergert <chergert redhat com>
Date: Sun Jul 17 16:43:36 2016 -0700
color-picker: use g_signal_connect_object()
Unless we are careful to disconnect, these will break if we unload/load
the plugin. We can cheat and just let object tracking handle this for us.
.../color-picker/gb-color-picker-workbench-addin.c | 36 +++++++++++---------
1 files changed, 20 insertions(+), 16 deletions(-)
---
diff --git a/plugins/color-picker/gb-color-picker-workbench-addin.c
b/plugins/color-picker/gb-color-picker-workbench-addin.c
index 4543f44..957e636 100644
--- a/plugins/color-picker/gb-color-picker-workbench-addin.c
+++ b/plugins/color-picker/gb-color-picker-workbench-addin.c
@@ -407,10 +407,11 @@ setup_view_cb (GtkWidget *widget,
g_action_map_add_action (G_ACTION_MAP (group), G_ACTION (menu_action));
set_menu_action_state (self, view, FALSE);
- g_signal_connect_swapped (menu_action,
- "activate",
- G_CALLBACK (activate_color_picker_action_cb),
- self);
+ g_signal_connect_object (menu_action,
+ "activate",
+ G_CALLBACK (activate_color_picker_action_cb),
+ self,
+ G_CONNECT_SWAPPED);
}
static void
@@ -483,18 +484,21 @@ gb_color_picker_workbench_addin_load (IdeWorkbenchAddin *addin,
ide_perspective_views_foreach (IDE_PERSPECTIVE (self->editor), (GtkCallback)setup_view_cb, self);
self->active_view = ide_layout_get_active_view (IDE_LAYOUT (self->editor));
- g_signal_connect_swapped (self->editor,
- "view-added",
- G_CALLBACK (view_added_cb),
- self);
- g_signal_connect_swapped (self->editor,
- "view-removed",
- G_CALLBACK (view_removed_cb),
- self);
- g_signal_connect_swapped (IDE_LAYOUT (self->editor),
- "notify::active-view",
- G_CALLBACK (active_view_changed_cb),
- self);
+ g_signal_connect_object (self->editor,
+ "view-added",
+ G_CALLBACK (view_added_cb),
+ self,
+ G_CONNECT_SWAPPED);
+ g_signal_connect_object (self->editor,
+ "view-removed",
+ G_CALLBACK (view_removed_cb),
+ self,
+ G_CONNECT_SWAPPED);
+ g_signal_connect_object (IDE_LAYOUT (self->editor),
+ "notify::active-view",
+ G_CALLBACK (active_view_changed_cb),
+ self,
+ G_CONNECT_SWAPPED);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]