[libpeas] Use g_signal_connect_object() now that it is fixed
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Use g_signal_connect_object() now that it is fixed
- Date: Sat, 20 Dec 2014 17:22:36 +0000 (UTC)
commit fed128baa6ead9f117e52892fa7079dc70ec5929
Author: Garrett Regier <garrettregier gmail com>
Date: Sat Dec 20 09:14:44 2014 -0800
Use g_signal_connect_object() now that it is fixed
libpeas-gtk/peas-gtk-plugin-manager-store.c | 18 ++++++-----
libpeas-gtk/peas-gtk-plugin-manager-view.c | 9 +++--
libpeas-gtk/peas-gtk-plugin-manager.c | 45 +++++++++++++++------------
libpeas/peas-extension-set.c | 29 +++--------------
4 files changed, 46 insertions(+), 55 deletions(-)
---
diff --git a/libpeas-gtk/peas-gtk-plugin-manager-store.c b/libpeas-gtk/peas-gtk-plugin-manager-store.c
index 01ab3c3..125506a 100644
--- a/libpeas-gtk/peas-gtk-plugin-manager-store.c
+++ b/libpeas-gtk/peas-gtk-plugin-manager-store.c
@@ -262,14 +262,16 @@ peas_gtk_plugin_manager_store_constructed (GObject *object)
g_object_ref (store->priv->engine);
- g_signal_connect_after (store->priv->engine,
- "load-plugin",
- G_CALLBACK (plugin_loaded_toggled_cb),
- store);
- g_signal_connect_after (store->priv->engine,
- "unload-plugin",
- G_CALLBACK (plugin_loaded_toggled_cb),
- store);
+ g_signal_connect_object (store->priv->engine,
+ "load-plugin",
+ G_CALLBACK (plugin_loaded_toggled_cb),
+ store,
+ G_CONNECT_AFTER);
+ g_signal_connect_object (store->priv->engine,
+ "unload-plugin",
+ G_CALLBACK (plugin_loaded_toggled_cb),
+ store,
+ G_CONNECT_AFTER);
peas_gtk_plugin_manager_store_reload (store);
diff --git a/libpeas-gtk/peas-gtk-plugin-manager-view.c b/libpeas-gtk/peas-gtk-plugin-manager-view.c
index 41ace4f..3ed2b02 100644
--- a/libpeas-gtk/peas-gtk-plugin-manager-view.c
+++ b/libpeas-gtk/peas-gtk-plugin-manager-view.c
@@ -709,10 +709,11 @@ peas_gtk_plugin_manager_view_constructed (GObject *object)
view->priv->show_builtin = TRUE;
peas_gtk_plugin_manager_view_set_show_builtin (view, FALSE);
- g_signal_connect (view->priv->engine,
- "notify::plugin-list",
- G_CALLBACK (plugin_list_changed_cb),
- view);
+ g_signal_connect_object (view->priv->engine,
+ "notify::plugin-list",
+ G_CALLBACK (plugin_list_changed_cb),
+ view,
+ 0);
G_OBJECT_CLASS (peas_gtk_plugin_manager_view_parent_class)->constructed (object);
}
diff --git a/libpeas-gtk/peas-gtk-plugin-manager.c b/libpeas-gtk/peas-gtk-plugin-manager.c
index 97981ac..67496a1 100644
--- a/libpeas-gtk/peas-gtk-plugin-manager.c
+++ b/libpeas-gtk/peas-gtk-plugin-manager.c
@@ -479,26 +479,31 @@ peas_gtk_plugin_manager_constructed (GObject *object)
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (pm->priv->view));
- g_signal_connect_swapped (selection,
- "changed",
- G_CALLBACK (selection_changed_cb),
- pm);
- g_signal_connect_swapped (pm->priv->view,
- "cursor-changed",
- G_CALLBACK (selection_changed_cb),
- pm);
- g_signal_connect (pm->priv->view,
- "populate-popup",
- G_CALLBACK (populate_popup_cb),
- pm);
- g_signal_connect_after (pm->priv->engine,
- "load-plugin",
- G_CALLBACK (plugin_loaded_toggled_cb),
- pm);
- g_signal_connect_after (pm->priv->engine,
- "unload-plugin",
- G_CALLBACK (plugin_loaded_toggled_cb),
- pm);
+ g_signal_connect_object (selection,
+ "changed",
+ G_CALLBACK (selection_changed_cb),
+ pm,
+ G_CONNECT_SWAPPED);
+ g_signal_connect_object (pm->priv->view,
+ "cursor-changed",
+ G_CALLBACK (selection_changed_cb),
+ pm,
+ G_CONNECT_SWAPPED);
+ g_signal_connect_object (pm->priv->view,
+ "populate-popup",
+ G_CALLBACK (populate_popup_cb),
+ pm,
+ 0);
+ g_signal_connect_object (pm->priv->engine,
+ "load-plugin",
+ G_CALLBACK (plugin_loaded_toggled_cb),
+ pm,
+ G_CONNECT_AFTER);
+ g_signal_connect_object (pm->priv->engine,
+ "unload-plugin",
+ G_CALLBACK (plugin_loaded_toggled_cb),
+ pm,
+ G_CONNECT_AFTER);
/* Update the button sensitivity */
selection_changed_cb (pm);
diff --git a/libpeas/peas-extension-set.c b/libpeas/peas-extension-set.c
index 938d411..42049d2 100644
--- a/libpeas/peas-extension-set.c
+++ b/libpeas/peas-extension-set.c
@@ -95,9 +95,6 @@ struct _PeasExtensionSetPrivate {
GParameter *parameters;
GList *extensions;
-
- gulong load_handler_id;
- gulong unload_handler_id;
};
typedef struct {
@@ -270,14 +267,12 @@ peas_extension_set_constructed (GObject *object)
for (l = plugins; l; l = l->next)
add_extension (set, (PeasPluginInfo *) l->data);
- set->priv->load_handler_id =
- g_signal_connect_data (set->priv->engine, "load-plugin",
- G_CALLBACK (add_extension), set,
- NULL, G_CONNECT_AFTER | G_CONNECT_SWAPPED);
- set->priv->unload_handler_id =
- g_signal_connect_data (set->priv->engine, "unload-plugin",
- G_CALLBACK (remove_extension), set,
- NULL, G_CONNECT_SWAPPED);
+ g_signal_connect_object (set->priv->engine, "load-plugin",
+ G_CALLBACK (add_extension), set,
+ G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+ g_signal_connect_object (set->priv->engine, "unload-plugin",
+ G_CALLBACK (remove_extension), set,
+ G_CONNECT_SWAPPED);
G_OBJECT_CLASS (peas_extension_set_parent_class)->constructed (object);
}
@@ -288,18 +283,6 @@ peas_extension_set_dispose (GObject *object)
PeasExtensionSet *set = PEAS_EXTENSION_SET (object);
GList *l;
- if (set->priv->load_handler_id != 0)
- {
- g_signal_handler_disconnect (set->priv->engine, set->priv->load_handler_id);
- set->priv->load_handler_id = 0;
- }
-
- if (set->priv->unload_handler_id != 0)
- {
- g_signal_handler_disconnect (set->priv->engine, set->priv->unload_handler_id);
- set->priv->unload_handler_id = 0;
- }
-
if (set->priv->extensions != NULL)
{
for (l = set->priv->extensions; l != NULL; l = l->next)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]