Commit 8216ba62 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

plug-ins/help/gimphelpitem.c plug-ins/help/gimphelplocale.c

2007-05-23  Sven Neumann  <sven@gimp.org>

	* plug-ins/help/gimphelpitem.c
	* plug-ins/help/gimphelplocale.c
	* plug-ins/help/help.c
	* plug-ins/help/gimphelpdomain.c: allocate structs using GSlice.

svn path=/trunk/; revision=22596
parent ab71eb9f
2007-05-23 Sven Neumann <sven@gimp.org>
* plug-ins/help/gimphelpitem.c
* plug-ins/help/gimphelplocale.c
* plug-ins/help/help.c
* plug-ins/help/gimphelpdomain.c: allocate structs using GSlice.
2007-05-23 Sven Neumann <sven@gimp.org>
* app/paint/gimppaintoptions.c
......@@ -58,7 +58,7 @@ gimp_help_domain_new (const gchar *domain_name,
const gchar *domain_uri,
const gchar *domain_root)
{
GimpHelpDomain *domain = g_new0 (GimpHelpDomain, 1);
GimpHelpDomain *domain = g_slice_new0 (GimpHelpDomain);
domain->help_domain = g_strdup (domain_name);
domain->help_uri = g_strdup (domain_uri);
......@@ -85,7 +85,8 @@ gimp_help_domain_free (GimpHelpDomain *domain)
g_free (domain->help_domain);
g_free (domain->help_uri);
g_free (domain->help_root);
g_free (domain);
g_slice_free (GimpHelpDomain, domain);
}
GimpHelpLocale *
......
......@@ -49,7 +49,7 @@ gimp_help_item_new (const gchar *ref,
const gchar *title,
const gchar *parent)
{
GimpHelpItem *item = g_new0 (GimpHelpItem, 1);
GimpHelpItem *item = g_slice_new0 (GimpHelpItem);
item->ref = g_strdup (ref);
item->title = g_strdup (title);
......@@ -67,5 +67,5 @@ gimp_help_item_free (GimpHelpItem *item)
g_list_free (item->children);
g_free (item);
g_slice_free (GimpHelpItem, item);
}
......@@ -52,7 +52,7 @@ static void locale_set_error (GError **error,
GimpHelpLocale *
gimp_help_locale_new (const gchar *locale_id)
{
GimpHelpLocale *locale = g_new0 (GimpHelpLocale, 1);
GimpHelpLocale *locale = g_slice_new0 (GimpHelpLocale);
locale->locale_id = g_strdup (locale_id);
......@@ -70,7 +70,7 @@ gimp_help_locale_free (GimpHelpLocale *locale)
g_list_free (locale->toplevel_items);
g_free (locale);
g_slice_free (GimpHelpLocale, locale);
}
const gchar *
......@@ -159,8 +159,8 @@ gimp_help_locale_parse (GimpHelpLocale *locale,
GError **error)
{
GMarkupParseContext *context;
LocaleParser *parser;
GIOChannel *io;
LocaleParser parser = { NULL, };
gboolean success;
g_return_val_if_fail (locale != NULL, FALSE);
......@@ -195,24 +195,21 @@ gimp_help_locale_parse (GimpHelpLocale *locale,
return FALSE;
}
parser = g_new0 (LocaleParser, 1);
parser.filename = filename;
parser.value = g_string_new (NULL);
parser.locale = locale;
parser.help_domain = help_domain;
parser.id_attr_name = g_strdup ("id");
parser->filename = filename;
parser->value = g_string_new (NULL);
parser->locale = locale;
parser->help_domain = help_domain;
parser->id_attr_name = g_strdup ("id");
context = g_markup_parse_context_new (&markup_parser, 0, parser, NULL);
context = g_markup_parse_context_new (&markup_parser, 0, &parser, NULL);
success = locale_parser_parse (context, io, error);
g_markup_parse_context_free (context);
g_io_channel_unref (io);
g_string_free (parser->value, TRUE);
g_free (parser->id_attr_name);
g_free (parser);
g_string_free (parser.value, TRUE);
g_free (parser.id_attr_name);
if (! success)
locale_set_error (error, _("Parse error in '%s':\n%s"), filename);
......
......@@ -243,9 +243,7 @@ load_help (const gchar *procedure,
const gchar *help_locales,
const gchar *help_id)
{
IdleHelp *idle_help;
idle_help = g_new0 (IdleHelp, 1);
IdleHelp *idle_help = g_slice_new (IdleHelp);
idle_help->procedure = g_strdup (procedure);
idle_help->help_domain = g_strdup (help_domain);
......@@ -304,7 +302,8 @@ load_help_idle (gpointer data)
g_free (idle_help->help_domain);
g_free (idle_help->help_locales);
g_free (idle_help->help_id);
g_free (idle_help);
g_slice_free (IdleHelp, idle_help);
return FALSE;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment