[farsight2/master] msn: use type##_parent_class pointer from G_DEFINE_TYPE

Olivier Crête olivier.crete at collabora.co.uk
Tue Jul 14 09:51:01 PDT 2009


---
 gst/fsmsnconference/fs-msn-connection.c |    8 ++------
 gst/fsmsnconference/fs-msn-session.c    |   10 ++++------
 gst/fsmsnconference/fs-msn-stream.c     |   11 ++++-------
 3 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/gst/fsmsnconference/fs-msn-connection.c b/gst/fsmsnconference/fs-msn-connection.c
index de22b4d..ca0cd4f 100644
--- a/gst/fsmsnconference/fs-msn-connection.c
+++ b/gst/fsmsnconference/fs-msn-connection.c
@@ -91,8 +91,6 @@ struct _FsMsnPollFD {
 
 G_DEFINE_TYPE(FsMsnConnection, fs_msn_connection, G_TYPE_OBJECT);
 
-static GObjectClass *parent_class = NULL;
-
 static void fs_msn_connection_dispose (GObject *object);
 static void fs_msn_connection_finalize (GObject *object);
 static void fs_msn_connection_get_property (GObject *object,
@@ -130,8 +128,6 @@ fs_msn_connection_class_init (FsMsnConnectionClass *klass)
 {
   GObjectClass *gobject_class = (GObjectClass *) klass;
 
-  parent_class = g_type_class_peek_parent (klass);
-
   gobject_class->dispose = fs_msn_connection_dispose;
   gobject_class->finalize = fs_msn_connection_finalize;
   gobject_class->get_property = fs_msn_connection_get_property;
@@ -215,7 +211,7 @@ fs_msn_connection_dispose (GObject *object)
 
   FS_MSN_CONNECTION_UNLOCK(self);
 
-  parent_class->dispose (object);
+  G_OBJECT_CLASS (fs_msn_connection_parent_class)->dispose (object);
 }
 
 static void
@@ -239,7 +235,7 @@ fs_msn_connection_finalize (GObject *object)
 
   g_static_rec_mutex_free (&self->mutex);
 
-  parent_class->finalize (object);
+  G_OBJECT_CLASS (fs_msn_connection_parent_class)->finalize (object);
 }
 
 /**
diff --git a/gst/fsmsnconference/fs-msn-session.c b/gst/fsmsnconference/fs-msn-session.c
index 190fc4c..69e3dfe 100644
--- a/gst/fsmsnconference/fs-msn-session.c
+++ b/gst/fsmsnconference/fs-msn-session.c
@@ -128,8 +128,6 @@ fs_msn_session_get_stream_transmitter_type (FsSession *session,
 static void _remove_stream (gpointer user_data,
                             GObject *where_the_object_was);
 
-static GObjectClass *parent_class = NULL;
-
 static void
 fs_msn_session_class_init (FsMsnSessionClass *klass)
 {
@@ -137,7 +135,6 @@ fs_msn_session_class_init (FsMsnSessionClass *klass)
   FsSessionClass *session_class;
 
   gobject_class = (GObjectClass *) klass;
-  parent_class = g_type_class_peek_parent (klass);
   session_class = FS_SESSION_CLASS (klass);
 
   gobject_class->set_property = fs_msn_session_set_property;
@@ -254,7 +251,7 @@ fs_msn_session_dispose (GObject *object)
 
  out:
 
-  parent_class->dispose (object);
+  G_OBJECT_CLASS (fs_msn_session_parent_class)->dispose (object);
 }
 
 static void
@@ -264,7 +261,7 @@ fs_msn_session_finalize (GObject *object)
 
   g_mutex_free (self->priv->mutex);
 
-  parent_class->finalize (object);
+  G_OBJECT_CLASS (fs_msn_session_parent_class)->finalize (object);
 }
 
 static void
@@ -406,7 +403,8 @@ fs_msn_session_constructed (GObject *object)
 
   gst_element_sync_state_with_parent (self->valve);
 
-  GST_CALL_PARENT (G_OBJECT_CLASS, constructed, (object));
+  if (G_OBJECT_CLASS (fs_msn_session_parent_class)->constructed)
+    G_OBJECT_CLASS (fs_msn_session_parent_class)->constructed (object);
 }
 
 
diff --git a/gst/fsmsnconference/fs-msn-stream.c b/gst/fsmsnconference/fs-msn-stream.c
index 6acf54a..dc80e79 100644
--- a/gst/fsmsnconference/fs-msn-stream.c
+++ b/gst/fsmsnconference/fs-msn-stream.c
@@ -141,8 +141,6 @@ static void
 _connection_failed (FsMsnConnection *connection, FsMsnStream *self);
 
 
-static GObjectClass *parent_class = NULL;
-
 static void
 fs_msn_stream_class_init (FsMsnStreamClass *klass)
 {
@@ -150,7 +148,6 @@ fs_msn_stream_class_init (FsMsnStreamClass *klass)
   FsStreamClass *stream_class = FS_STREAM_CLASS (klass);
 
   gobject_class = (GObjectClass *) klass;
-  parent_class = g_type_class_peek_parent (klass);
 
   gobject_class->set_property = fs_msn_stream_set_property;
   gobject_class->get_property = fs_msn_stream_get_property;
@@ -288,7 +285,7 @@ fs_msn_stream_dispose (GObject *object)
   gst_object_unref (conference);
   gst_object_unref (conference);
 
-  parent_class->dispose (object);
+  G_OBJECT_CLASS (fs_msn_stream_parent_class)->dispose (object);
 }
 
 static void
@@ -298,7 +295,7 @@ fs_msn_stream_finalize (GObject *object)
 
   g_mutex_free (self->priv->mutex);
 
-  parent_class->finalize (object);
+  G_OBJECT_CLASS (fs_msn_stream_parent_class)->finalize (object);
 }
 
 
@@ -514,8 +511,8 @@ fs_msn_stream_constructed (GObject *object)
           &self->priv->construction_error))
     return;
 
-
-  GST_CALL_PARENT (G_OBJECT_CLASS, constructed, (object));
+  if (G_OBJECT_CLASS (fs_msn_stream_parent_class)->constructed)
+    G_OBJECT_CLASS (fs_msn_stream_parent_class)->constructed (object);
 }
 
 
-- 
1.5.6.5




More information about the farsight-commits mailing list