totem r5987 - in trunk: . src/plugins/properties



Author: pwithnall
Date: Tue Feb 17 00:06:24 2009
New Revision: 5987
URL: http://svn.gnome.org/viewvc/totem?rev=5987&view=rev

Log:
2009-02-17  Philip Withnall  <philip tecnocode co uk>

	* src/plugins/properties/bacon-video-widget-properties.c
	(bacon_video_widget_properties_class_init),
	(bacon_video_widget_properties_init),
	(bacon_video_widget_properties_dispose): Tidy up
	BaconVideoWidgetProperties a little and remove a deprecated GTK+ call.
	(Closes: #572089)



Modified:
   trunk/ChangeLog
   trunk/src/plugins/properties/bacon-video-widget-properties.c

Modified: trunk/src/plugins/properties/bacon-video-widget-properties.c
==============================================================================
--- trunk/src/plugins/properties/bacon-video-widget-properties.c	(original)
+++ trunk/src/plugins/properties/bacon-video-widget-properties.c	Tue Feb 17 00:06:24 2009
@@ -77,35 +77,43 @@
 		g_free (temp); \
 	} while (0)
 
-struct BaconVideoWidgetPropertiesPrivate
-{
+static void bacon_video_widget_properties_dispose (GObject *object);
+
+struct BaconVideoWidgetPropertiesPrivate {
 	GtkBuilder *xml;
 	int time;
 };
 
-static GtkWidgetClass *parent_class = NULL;
+#define BACON_VIDEO_WIDGET_PROPERTIES_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetPropertiesPrivate))
 
-G_DEFINE_TYPE(BaconVideoWidgetProperties, bacon_video_widget_properties, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (BaconVideoWidgetProperties, bacon_video_widget_properties, GTK_TYPE_VBOX)
 
 static void
-bacon_video_widget_properties_init (BaconVideoWidgetProperties *props)
+bacon_video_widget_properties_class_init (BaconVideoWidgetPropertiesClass *klass)
 {
-	props->priv = g_new0 (BaconVideoWidgetPropertiesPrivate, 1);
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	g_type_class_add_private (klass, sizeof (BaconVideoWidgetPropertiesPrivate));
+
+	object_class->dispose = bacon_video_widget_properties_dispose;
 }
 
 static void
-bacon_video_widget_properties_finalize (GObject *object)
+bacon_video_widget_properties_init (BaconVideoWidgetProperties *props)
 {
-	BaconVideoWidgetProperties *props = BACON_VIDEO_WIDGET_PROPERTIES (object);
+	props->priv = G_TYPE_INSTANCE_GET_PRIVATE (props, BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetPropertiesPrivate);
+}
 
-	g_return_if_fail (object != NULL);
+static void
+bacon_video_widget_properties_dispose (GObject *object)
+{
+	BaconVideoWidgetPropertiesPrivate *priv = BACON_VIDEO_WIDGET_PROPERTIES_GET_PRIVATE (object);
 
-	g_object_unref (props->priv->xml);
-	g_free (props->priv);
+	if (priv->xml != NULL)
+		g_object_unref (priv->xml);
+	priv->xml = NULL;
 
-	if (G_OBJECT_CLASS (parent_class)->finalize != NULL) {
-		(* G_OBJECT_CLASS (parent_class)->finalize) (object);
-	}
+	G_OBJECT_CLASS (bacon_video_widget_properties_parent_class)->dispose (object);
 }
 
 static void
@@ -310,11 +318,3 @@
 	return GTK_WIDGET (props);
 }
 
-static void
-bacon_video_widget_properties_class_init (BaconVideoWidgetPropertiesClass *klass)
-{
-	parent_class = gtk_type_class (gtk_vbox_get_type ());
-
-	G_OBJECT_CLASS (klass)->finalize = bacon_video_widget_properties_finalize;
-}
-



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