[maemo-commits] [maemo-commits] r17607 - in projects/haf/trunk/gconf2: . backends

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Mar 9 12:34:22 EET 2009
Author: richard
Date: 2009-03-09 12:34:18 +0200 (Mon, 09 Mar 2009)
New Revision: 17607

Modified:
   projects/haf/trunk/gconf2/ChangeLog
   projects/haf/trunk/gconf2/backends/markup-tree.c
Log:
Merge revision 2764 from upstream, further optimizations to the markup
backend.


Modified: projects/haf/trunk/gconf2/ChangeLog
===================================================================
--- projects/haf/trunk/gconf2/ChangeLog	2009-03-09 10:29:34 UTC (rev 17606)
+++ projects/haf/trunk/gconf2/ChangeLog	2009-03-09 10:34:18 UTC (rev 17607)
@@ -1,5 +1,10 @@
 2009-03-09  Richard Hult  <richard at imendio.com>
 
+	* Merge revision 2764 from upstream, further optimizations to the
+	markup backend.
+
+2009-03-09  Richard Hult  <richard at imendio.com>
+
 	* Merge revision 2763 from upstream, to optimize the markup
 	backend.
 

Modified: projects/haf/trunk/gconf2/backends/markup-tree.c
===================================================================
--- projects/haf/trunk/gconf2/backends/markup-tree.c	2009-03-09 10:29:34 UTC (rev 17606)
+++ projects/haf/trunk/gconf2/backends/markup-tree.c	2009-03-09 10:34:18 UTC (rev 17607)
@@ -3808,10 +3808,7 @@
     case GCONF_VALUE_PAIR:
       break;
     }
-  
-  if (fputs (">\n", f) < 0)
-    return FALSE;
-  
+    
   switch (value->type)
     {
     case GCONF_VALUE_STRING:
@@ -3820,7 +3817,7 @@
         
         s = g_markup_escape_text (gconf_value_get_string (value),
                                   -1);
-        if (fprintf (f, "%s<stringvalue>%s</stringvalue>\n",
+        if (fprintf (f, ">\n%s<stringvalue>%s</stringvalue>\n",
                      make_whitespace (indent + INDENT_SPACES), s) < 0)
           {
             g_free (s);
@@ -3832,16 +3829,22 @@
       break;
       
     case GCONF_VALUE_LIST:
+      if (fputs (">\n", f) < 0)
+	return FALSE;
       if (!write_list_children (value, f, indent + INDENT_SPACES))
         return FALSE;
       break;
       
     case GCONF_VALUE_PAIR:
+      if (fputs (">\n", f) < 0)
+	return FALSE;
       if (!write_pair_children (value, f, indent + INDENT_SPACES))
         return FALSE;
       break;
       
     case GCONF_VALUE_SCHEMA:
+      if (fputs (">\n", f) < 0)
+	return FALSE;
       if (!write_schema_children (value,
                                   f,
                                   indent + INDENT_SPACES,
@@ -3854,10 +3857,14 @@
     case GCONF_VALUE_BOOL:
     case GCONF_VALUE_FLOAT:
     case GCONF_VALUE_INVALID:
+      if (fputs ("/>\n", f) < 0)
+	return FALSE;
+      single_element = TRUE;
       break;
     }
 
-  if (fprintf (f, "%s</%s>\n", make_whitespace (indent), closing_element) < 0)
+  if (!single_element)
+    if (fprintf (f, "%s</%s>\n", make_whitespace (indent), closing_element) < 0)
       return FALSE;
 
   return TRUE;


More information about the maemo-commits mailing list