Mercurial > geeqie
diff src/rcfile.c @ 1484:9c16a93a0fdf
improved sidebar configuration
author | nadvornik |
---|---|
date | Sun, 29 Mar 2009 14:20:44 +0000 |
parents | 607c60506863 |
children | 73cecf473802 |
line wrap: on
line diff
--- a/src/rcfile.c Sun Mar 29 10:36:13 2009 +0000 +++ b/src/rcfile.c Sun Mar 29 14:20:44 2009 +0000 @@ -486,7 +486,7 @@ *----------------------------------------------------------------------------- */ -gboolean save_options_to(const gchar *utf8_path, ConfOptions *options) +gboolean save_config_to_file(const gchar *utf8_path, ConfOptions *options) { SecureSaveInfo *ssi; gchar *rc_pathl; @@ -1167,19 +1167,12 @@ *----------------------------------------------------------------------------- */ -gboolean load_options_from(const gchar *utf8_path, ConfOptions *options, gboolean startup) +gboolean load_config_from_buf(const gchar *buf, gsize size, gboolean startup) { - gsize size; - gchar *buf; GMarkupParseContext *context; gboolean ret = TRUE; GQParserData *parser_data; - if (g_file_get_contents(utf8_path, &buf, &size, NULL) == FALSE) - { - return FALSE; - } - parser_data = g_new0(GQParserData, 1); parser_data->startup = startup; @@ -1195,8 +1188,22 @@ g_free(parser_data); + g_markup_parse_context_free(context); + return ret; +} + +gboolean load_config_from_file(const gchar *utf8_path, gboolean startup) +{ + gsize size; + gchar *buf; + gboolean ret = TRUE; + + if (g_file_get_contents(utf8_path, &buf, &size, NULL) == FALSE) + { + return FALSE; + } + ret = load_config_from_buf(buf, size, startup); g_free(buf); - g_markup_parse_context_free(context); return ret; }