gconf r2764 - in trunk: . backends
- From: michael svn gnome org
- To: svn-commits-list gnome org
- Subject: gconf r2764 - in trunk: . backends
- Date: Tue, 10 Feb 2009 17:27:35 +0000 (UTC)
Author: michael
Date: Tue Feb 10 17:27:35 2009
New Revision: 2764
URL: http://svn.gnome.org/viewvc/gconf?rev=2764&view=rev
Log:
2009-02-10 Michael Meeks <michael meeks novell com>
* backends/markup-tree.c (write_value_element): close empty
value elements immediately to save parsing time.
Modified:
trunk/ChangeLog
trunk/backends/markup-tree.c
Modified: trunk/backends/markup-tree.c
==============================================================================
--- trunk/backends/markup-tree.c (original)
+++ trunk/backends/markup-tree.c Tue Feb 10 17:27:35 2009
@@ -3809,10 +3809,7 @@
case GCONF_VALUE_PAIR:
break;
}
-
- if (fputs (">\n", f) < 0)
- return FALSE;
-
+
switch (value->type)
{
case GCONF_VALUE_STRING:
@@ -3821,7 +3818,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);
@@ -3833,16 +3830,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,
@@ -3855,10 +3858,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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]