Mercurial > geeqie
diff src/rcfile.c @ 1314:8cca18bce950
simplified config writing
author | nadvornik |
---|---|
date | Mon, 23 Feb 2009 22:13:09 +0000 |
parents | 1ffa5222dc61 |
children | c1d108ab3388 |
line wrap: on
line diff
--- a/src/rcfile.c Mon Feb 23 21:21:15 2009 +0000 +++ b/src/rcfile.c Mon Feb 23 22:13:09 2009 +0000 @@ -447,8 +447,7 @@ " color profile options will have no effect.\n-->\n", GQ_APPNAME); #endif - write_indent(outstr, indent); - g_string_append_printf(outstr, "<color_profiles\n"); + WRITE_STRING("<color_profiles\n"); indent++; WRITE_INT(options->color_profile, screen_type); WRITE_CHAR(options->color_profile, screen_file); @@ -456,24 +455,20 @@ WRITE_BOOL(options->color_profile, use_image); WRITE_INT(options->color_profile, input_type); indent--; - write_indent(outstr, indent); - g_string_append_printf(outstr, ">\n"); + WRITE_STRING(">\n"); indent++; for (i = 0; i < COLOR_PROFILE_INPUTS; i++) { - write_indent(outstr, indent); - g_string_append_printf(outstr, "<profile\n"); + WRITE_STRING("<profile\n"); indent++; write_char_option(outstr, indent, "input_file", options->color_profile.input_file[i]); write_char_option(outstr, indent, "input_name", options->color_profile.input_name[i]); indent--; - write_indent(outstr, indent); - g_string_append_printf(outstr, "/>\n"); + WRITE_STRING("/>\n"); } indent--; - write_indent(outstr, indent); - g_string_append_printf(outstr, "</color_profiles>\n"); + WRITE_STRING("</color_profiles>\n"); } @@ -507,16 +502,16 @@ g_string_append_printf(outstr, "######################################################################\n"); WRITE_SEPARATOR(); - g_string_append_printf(outstr, "# Note: This file is autogenerated. Options can be changed here,\n"); - g_string_append_printf(outstr, "# but user comments and formatting will be lost.\n"); + WRITE_STRING("# Note: This file is autogenerated. Options can be changed here,\n"); + WRITE_STRING("# but user comments and formatting will be lost.\n"); WRITE_SEPARATOR(); - g_string_append_printf(outstr, "-->\n"); + WRITE_STRING("-->\n"); WRITE_SEPARATOR(); - g_string_append_printf(outstr, "<global\n"); + WRITE_STRING("<global\n"); + write_global_attributes(outstr, indent + 1); + WRITE_STRING(">\n"); + indent++; - write_global_attributes(outstr, indent); - write_indent(outstr, indent); - g_string_append_printf(outstr, ">\n"); write_color_profile(outstr, indent); @@ -525,14 +520,12 @@ WRITE_SEPARATOR(); WRITE_SUBTITLE("Layout Options - defaults"); - write_indent(outstr, indent); - g_string_append_printf(outstr, "<layout\n"); + WRITE_STRING("<layout\n"); layout_write_attributes(&options->layout, outstr, indent + 1); - write_indent(outstr, indent); - g_string_append_printf(outstr, "/>\n"); + WRITE_STRING("/>\n"); indent--; - g_string_append_printf(outstr, "</global>\n"); + WRITE_STRING("</global>\n"); WRITE_SEPARATOR(); WRITE_SUBTITLE("Layout Options");