[empathy] CameraMonitor: add empathy_camera_monitor_new()



commit 624bbe7ac793e34aa9b0db0122b973eadd218770
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Mon Aug 15 11:29:59 2011 +0100

    CameraMonitor: add empathy_camera_monitor_new()
    
    Which doesn't return a singleton but a new object.

 libempathy/empathy-camera-monitor.c |   48 ++++++++++++++++-------------------
 libempathy/empathy-camera-monitor.h |    1 +
 2 files changed, 23 insertions(+), 26 deletions(-)
---
diff --git a/libempathy/empathy-camera-monitor.c b/libempathy/empathy-camera-monitor.c
index da6b234..3b5221e 100644
--- a/libempathy/empathy-camera-monitor.c
+++ b/libempathy/empathy-camera-monitor.c
@@ -201,30 +201,6 @@ empathy_camera_monitor_dispose (GObject *object)
   G_OBJECT_CLASS (empathy_camera_monitor_parent_class)->dispose (object);
 }
 
-static GObject *
-empathy_camera_monitor_constructor (GType type,
-    guint n_props,
-    GObjectConstructParam *props)
-{
-  GObject *retval;
-
-  if (manager_singleton)
-    {
-      retval = g_object_ref (manager_singleton);
-    }
-  else
-    {
-      retval =
-          G_OBJECT_CLASS (empathy_camera_monitor_parent_class)->
-          constructor (type, n_props, props);
-
-      manager_singleton = EMPATHY_CAMERA_MONITOR (retval);
-      g_object_add_weak_pointer (retval, (gpointer) & manager_singleton);
-    }
-
-  return retval;
-}
-
 static void
 empathy_camera_monitor_constructed (GObject *object)
 {
@@ -241,7 +217,6 @@ empathy_camera_monitor_class_init (EmpathyCameraMonitorClass *klass)
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->dispose = empathy_camera_monitor_dispose;
-  object_class->constructor = empathy_camera_monitor_constructor;
   object_class->constructed = empathy_camera_monitor_constructed;
   object_class->get_property = empathy_camera_monitor_get_property;
 
@@ -291,7 +266,28 @@ empathy_camera_monitor_init (EmpathyCameraMonitor *self)
 EmpathyCameraMonitor *
 empathy_camera_monitor_dup_singleton (void)
 {
-  return g_object_new (EMPATHY_TYPE_CAMERA_MONITOR, NULL);
+  GObject *retval;
+
+  if (manager_singleton)
+    {
+      retval = g_object_ref (manager_singleton);
+    }
+  else
+    {
+      retval = g_object_new (EMPATHY_TYPE_CAMERA_MONITOR, NULL);
+
+      manager_singleton = EMPATHY_CAMERA_MONITOR (retval);
+      g_object_add_weak_pointer (retval, (gpointer) &manager_singleton);
+    }
+
+  return EMPATHY_CAMERA_MONITOR (retval);
+}
+
+EmpathyCameraMonitor *
+empathy_camera_monitor_new (void)
+{
+  return EMPATHY_CAMERA_MONITOR (
+      g_object_new (EMPATHY_TYPE_CAMERA_MONITOR, NULL));
 }
 
 gboolean empathy_camera_monitor_get_available (EmpathyCameraMonitor *self)
diff --git a/libempathy/empathy-camera-monitor.h b/libempathy/empathy-camera-monitor.h
index 2f26670..f627f7b 100644
--- a/libempathy/empathy-camera-monitor.h
+++ b/libempathy/empathy-camera-monitor.h
@@ -59,6 +59,7 @@ GType empathy_camera_get_type (void) G_GNUC_CONST;
 GType empathy_camera_monitor_get_type (void) G_GNUC_CONST;
 
 EmpathyCameraMonitor *empathy_camera_monitor_dup_singleton (void);
+EmpathyCameraMonitor *empathy_camera_monitor_new (void);
 
 gboolean empathy_camera_monitor_get_available (EmpathyCameraMonitor *self);
 



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