grim/gplate

843398396f00
Parents 0136c5009dc3
Children b2ff0fcda944
Use the list functions in GPlateTemplate rather than the list itself
--- a/gplate/gplate-template.c Sun Feb 17 07:13:28 2008 -0600
+++ b/gplate/gplate-template.c Sun Feb 17 07:21:57 2008 -0600
@@ -570,22 +570,27 @@
gplate_template_render(GPlateTemplate *tplate, const gchar *tplate_string,
GError **error)
{
- GList *tokens = NULL, *l = NULL;
+ GPlateTemplatePrivate *priv = NULL;
+ GPlateTag *tag = NULL;
GString *str = NULL;
gchar *ret = NULL;
g_return_val_if_fail(GPLATE_IS_TEMPLATE(tplate), NULL);
g_return_val_if_fail(tplate_string, NULL);
- tokens = gplate_template_tokenize(tplate, tplate_string, error);
- if(!tokens)
+ priv = GPLATE_TEMPLATE_GET_PRIVATE(tplate);
+
+ priv->tokens = gplate_template_tokenize(tplate, tplate_string, error);
+ if(!priv->tokens)
return g_strdup("");
/* for whatever reason, using g_string_new_len here doesn't work */
str = g_string_new("");
- for(l = tokens; l; l = l->next) {
- GPlateTag *tag = GPLATE_TAG(l->data);
+ for(tag = gplate_template_first_tag(tplate);
+ tag;
+ tag = gplate_template_next_tag(tplate))
+ {
GType ttype = G_OBJECT_TYPE(tag);
gchar *contents = NULL, *output = NULL;