beagle r4659 - trunk/libbeagle/beagle



Author: arunsr
Date: Sat Apr  5 22:21:17 2008
New Revision: 4659
URL: http://svn.gnome.org/viewvc/beagle?rev=4659&view=rev

Log:
Initialise private fields for various QueryPart classes to NULL

While this is strictly not necessary (glib automatically zeroes out the memory
for private data), it's probably better that we do this in case glib behaviour
changes at some point.


Modified:
   trunk/libbeagle/beagle/beagle-query-part-human.c
   trunk/libbeagle/beagle/beagle-query-part-property.c
   trunk/libbeagle/beagle/beagle-query-part-text.c
   trunk/libbeagle/beagle/beagle-query-part-uri.c
   trunk/libbeagle/beagle/beagle-query-part-wildcard.c

Modified: trunk/libbeagle/beagle/beagle-query-part-human.c
==============================================================================
--- trunk/libbeagle/beagle/beagle-query-part-human.c	(original)
+++ trunk/libbeagle/beagle/beagle-query-part-human.c	Sat Apr  5 22:21:17 2008
@@ -61,6 +61,19 @@
 }
 
 static void
+beagle_query_part_human_constructed (GObject *obj)
+{
+	BeagleQueryPartHuman *part = BEAGLE_QUERY_PART_HUMAN (obj);
+	BeagleQueryPartHumanPrivate *priv;
+
+	if (G_OBJECT_CLASS (parent_class)->constructed)
+		G_OBJECT_CLASS (parent_class)->constructed (obj);
+
+	priv = BEAGLE_QUERY_PART_HUMAN_GET_PRIVATE (part);
+	priv->string = NULL;
+}
+
+static void
 beagle_query_part_human_finalize (GObject *obj)
 {
 	BeagleQueryPartHuman *part = BEAGLE_QUERY_PART_HUMAN (obj);
@@ -80,6 +93,7 @@
 
         parent_class = g_type_class_peek_parent (klass);
 
+        obj_class->constructed = beagle_query_part_human_constructed;
         obj_class->finalize = beagle_query_part_human_finalize;
         query_part_class->to_xml = beagle_query_part_human_to_xml;
 

Modified: trunk/libbeagle/beagle/beagle-query-part-property.c
==============================================================================
--- trunk/libbeagle/beagle/beagle-query-part-property.c	(original)
+++ trunk/libbeagle/beagle/beagle-query-part-property.c	Sat Apr  5 22:21:17 2008
@@ -77,6 +77,20 @@
 }
 
 static void
+beagle_query_part_property_constructed (GObject *obj)
+{
+	BeagleQueryPartProperty *part = BEAGLE_QUERY_PART_PROPERTY (obj);
+	BeagleQueryPartPropertyPrivate *priv;
+
+	if (G_OBJECT_CLASS (parent_class)->constructed)
+		G_OBJECT_CLASS (parent_class)->constructed (obj);
+
+	priv = BEAGLE_QUERY_PART_PROPERTY_GET_PRIVATE (part);
+	priv->key = NULL;
+	priv->value = NULL;
+}
+
+static void
 beagle_query_part_property_finalize (GObject *obj)
 {
 	BeagleQueryPartProperty *part = BEAGLE_QUERY_PART_PROPERTY (obj);
@@ -97,6 +111,7 @@
 	
         parent_class = g_type_class_peek_parent (klass);
 	
+        obj_class->constructed = beagle_query_part_property_constructed;
         obj_class->finalize = beagle_query_part_property_finalize;
         query_part_class->to_xml = beagle_query_part_property_to_xml;
 	

Modified: trunk/libbeagle/beagle/beagle-query-part-text.c
==============================================================================
--- trunk/libbeagle/beagle/beagle-query-part-text.c	(original)
+++ trunk/libbeagle/beagle/beagle-query-part-text.c	Sat Apr  5 22:21:17 2008
@@ -73,6 +73,19 @@
 }
 
 static void
+beagle_query_part_text_constructed (GObject *obj)
+{
+	BeagleQueryPartText *part = BEAGLE_QUERY_PART_TEXT (obj);
+	BeagleQueryPartTextPrivate *priv;
+
+	if (G_OBJECT_CLASS (parent_class)->constructed)
+		G_OBJECT_CLASS (parent_class)->constructed (obj);
+
+	priv = BEAGLE_QUERY_PART_TEXT_GET_PRIVATE (part);
+	priv->text = NULL;
+}
+
+static void
 beagle_query_part_text_finalize (GObject *obj)
 {
 	BeagleQueryPartText *part = BEAGLE_QUERY_PART_TEXT (obj);
@@ -92,6 +105,7 @@
 	
         parent_class = g_type_class_peek_parent (klass);
 	
+        obj_class->constructed = beagle_query_part_text_constructed;
         obj_class->finalize = beagle_query_part_text_finalize;
         query_part_class->to_xml = beagle_query_part_text_to_xml;
 	

Modified: trunk/libbeagle/beagle/beagle-query-part-uri.c
==============================================================================
--- trunk/libbeagle/beagle/beagle-query-part-uri.c	(original)
+++ trunk/libbeagle/beagle/beagle-query-part-uri.c	Sat Apr  5 22:21:17 2008
@@ -61,6 +61,19 @@
 }
 
 static void
+beagle_query_part_uri_constructed (GObject *obj)
+{
+	BeagleQueryPartUri *part = BEAGLE_QUERY_PART_URI (obj);
+	BeagleQueryPartUriPrivate *priv;
+
+	if (G_OBJECT_CLASS (parent_class)->constructed)
+		G_OBJECT_CLASS (parent_class)->constructed (obj);
+
+	priv = BEAGLE_QUERY_PART_URI_GET_PRIVATE (part);
+	priv->uri = NULL;
+}
+
+static void
 beagle_query_part_uri_finalize (GObject *obj)
 {
 	BeagleQueryPartUri *part = BEAGLE_QUERY_PART_URI (obj);
@@ -80,6 +93,7 @@
 
         parent_class = g_type_class_peek_parent (klass);
 
+        obj_class->constructed = beagle_query_part_uri_constructed;
         obj_class->finalize = beagle_query_part_uri_finalize;
         query_part_class->to_xml = beagle_query_part_uri_to_xml;
 

Modified: trunk/libbeagle/beagle/beagle-query-part-wildcard.c
==============================================================================
--- trunk/libbeagle/beagle/beagle-query-part-wildcard.c	(original)
+++ trunk/libbeagle/beagle/beagle-query-part-wildcard.c	Sat Apr  5 22:21:17 2008
@@ -61,6 +61,19 @@
 }
 
 static void
+beagle_query_part_wildcard_constructed (GObject *obj)
+{
+	BeagleQueryPartWildcard *part = BEAGLE_QUERY_PART_WILDCARD (obj);
+	BeagleQueryPartWildcardPrivate *priv;
+
+	if (G_OBJECT_CLASS (parent_class)->constructed)
+		G_OBJECT_CLASS (parent_class)->constructed (obj);
+
+	priv = BEAGLE_QUERY_PART_WILDCARD_GET_PRIVATE (part);
+	priv->query_string = NULL;
+}
+
+static void
 beagle_query_part_wildcard_finalize (GObject *obj)
 {
 	BeagleQueryPartWildcard *part = BEAGLE_QUERY_PART_WILDCARD (obj);
@@ -80,6 +93,7 @@
 	
         parent_class = g_type_class_peek_parent (klass);
 	
+        obj_class->constructed = beagle_query_part_wildcard_constructed;
         obj_class->finalize = beagle_query_part_wildcard_finalize;
         query_part_class->to_xml = beagle_query_part_wildcard_to_xml;
 	



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