[totem] Port the Galago and Tracker plugins to libpeas 0.5.4



commit 06dd10fd160682f63b96861b9d2f2eba258d9712
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Aug 9 09:26:21 2010 +0100

    Port the Galago and Tracker plugins to libpeas 0.5.4

 src/plugins/galago/totem-galago.c   |   17 +++++++++++++----
 src/plugins/tracker/totem-tracker.c |   16 ++++++++++++----
 2 files changed, 25 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/galago/totem-galago.c b/src/plugins/galago/totem-galago.c
index b6d4ec4..b7ffd90 100644
--- a/src/plugins/galago/totem-galago.c
+++ b/src/plugins/galago/totem-galago.c
@@ -152,15 +152,18 @@ property_notify_cb (TotemObject *totem,
 }
 
 static void
-impl_activate (PeasActivatable *plugin, GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemGalagoPlugin *pi = TOTEM_GALAGO_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
+	TotemObject *totem;
+
+	g_object_get (plugin, "object", &totem, NULL);
 
 	if (!galago_is_connected ()) {
 		GtkWindow *window = totem_get_main_window (totem);
 		totem_interface_error (_("Error loading Galago plugin"), _("Could not connect to the Galago daemon."), window);
 		g_object_unref (window);
+		g_object_unref (totem);
 
 		return;
 	}
@@ -176,20 +179,26 @@ impl_activate (PeasActivatable *plugin, GObject *object)
 
 	/* Force setting the current status */
 	totem_galago_update_from_state (totem, pi);
+
+	g_object_unref (totem);
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin, GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemGalagoPlugin *pi = TOTEM_GALAGO_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
+	TotemObject *totem;
 
 	/* Failed to initialise */
 	if (!galago_is_connected ())
 		return;
 
+	g_object_get (plugin, "object", &totem, NULL);
+
 	g_signal_handler_disconnect (G_OBJECT (totem), pi->handler_id_fullscreen);
 	g_signal_handler_disconnect (G_OBJECT (totem), pi->handler_id_playing);
 
+	g_object_unref (totem);
+
 	totem_galago_set_idleness (pi, FALSE);
 }
diff --git a/src/plugins/tracker/totem-tracker.c b/src/plugins/tracker/totem-tracker.c
index fb25583..bf74ffd 100644
--- a/src/plugins/tracker/totem-tracker.c
+++ b/src/plugins/tracker/totem-tracker.c
@@ -72,19 +72,27 @@ totem_tracker_plugin_init (TotemTrackerPlugin *plugin)
 }
 
 static void
-impl_activate (PeasActivatable *plugin, GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	GtkWidget *widget;
-	TotemObject *totem = TOTEM_OBJECT (object);
+	TotemObject *totem;
+
+	g_object_get (plugin, "object", &totem, NULL);
 
 	widget = totem_tracker_widget_new (totem);
 	gtk_widget_show (widget);
 	totem_add_sidebar_page (totem, "tracker", _("Local Search"), widget);
+
+	g_object_unref (totem);
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin, GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
-	totem_remove_sidebar_page (TOTEM_OBJECT (object), "tracker");
+	TotemObject *totem;
+
+	g_object_get (plugin, "object", &totem, NULL);
+	totem_remove_sidebar_page (totem, "tracker");
+	g_object_unref (totem);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]