[evince] [totem-scrsaver] Use g_type_class_add_private instead of g_new to allocate priv struct



commit 242ad429c3a90bbfaff253beebc9fe8582738ca7
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sat May 22 19:15:41 2010 +0200

    [totem-scrsaver] Use g_type_class_add_private instead of g_new to allocate priv struct

 cut-n-paste/totem-screensaver/totem-scrsaver.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/cut-n-paste/totem-screensaver/totem-scrsaver.c b/cut-n-paste/totem-screensaver/totem-scrsaver.c
index efa2b31..ba05d3f 100644
--- a/cut-n-paste/totem-screensaver/totem-scrsaver.c
+++ b/cut-n-paste/totem-screensaver/totem-scrsaver.c
@@ -345,6 +345,8 @@ totem_scrsaver_class_init (TotemScrsaverClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+	g_type_class_add_private (klass, sizeof (TotemScrsaverPrivate));
+
 	object_class->finalize = totem_scrsaver_finalize;
 }
 
@@ -367,7 +369,9 @@ totem_scrsaver_new (void)
 static void
 totem_scrsaver_init (TotemScrsaver *scr)
 {
-	scr->priv = g_new0 (TotemScrsaverPrivate, 1);
+	scr->priv = G_TYPE_INSTANCE_GET_PRIVATE (scr,
+						 TOTEM_TYPE_SCRSAVER,
+						 TotemScrsaverPrivate);
 
 	screensaver_init_dbus (scr);
 #ifdef GDK_WINDOWING_X11



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