--- a/gplate/gplate-print-function.c Tue Feb 19 23:51:18 2008 -0600
+++ b/gplate/gplate-print-function.c Tue Feb 19 23:52:37 2008 -0600
@@ -22,6 +22,9 @@
#include <gplate/gplate-print-function.h>
+#include <gplate/gplate-collection.h> +#include <gplate/gplate-util.h> /******************************************************************************
*****************************************************************************/
@@ -30,7 +33,26 @@
- return (contents) ? g_strdup(contents) : g_strdup("");
+ /* check for a quoted string, if it is quoted, we don't need to do + * anything, since it's already stored in ret. + if(!gplate_util_is_quoted_string(contents, &ret)) { + GPlateVariable *var = NULL; + var = gplate_collection_find_variable(GPLATE_COLLECTION(tplate), + if(GPLATE_IS_VARIABLE(var)) { + const gchar *val = gplate_variable_get_value(var); + return (ret) ? ret : g_strdup(""); /******************************************************************************
--- a/gplate/gplate-variable-tag.c Tue Feb 19 23:51:18 2008 -0600
+++ b/gplate/gplate-variable-tag.c Tue Feb 19 23:52:37 2008 -0600
@@ -43,78 +43,6 @@
-gplate_variable_tag_get_contents(const GPlateTag *tag) {
- GPlateTemplate *tplate = NULL;
- GPlateVariable *variable = NULL;
- GMatchInfo *info = NULL;
- gchar *name = NULL, *contents = NULL;
- const gchar *value = NULL;
- /* create our regex with available variable characters and ignore
- * everything after the first variable.
- * We shouldn't be seeing newlines here since the contents is
- * stripped before our tag even gets created.
- regex = g_regex_new("([A-Za-z0-9_.]+).*", 0, 0, NULL);
- /* grab the contents from the parent */
- contents = GPLATE_TAG_CLASS(parent_class)->get_contents(tag);
- /* make sure our regex matches */
- if(!g_regex_match(regex, contents, 0, &info)) {
- /* we don't need the regex anymore */
- /* make sure we have the correct number of matches */
- if(g_match_info_get_match_count(info) < 2) {
- g_match_info_free(info);
- /* get and validate the variable name */
- name = g_match_info_fetch(info, 1);
- g_match_info_free(info);
- /* find the variable from the name */
- tplate = gplate_tag_get_template(tag);
- variable = gplate_collection_find_variable(GPLATE_COLLECTION(tplate),
- /* clean up the match info */
- g_match_info_free(info);
- /* validate our variable */
- if(!GPLATE_IS_VARIABLE(variable))
- value = gplate_variable_get_value(variable);
- return (value) ? g_strdup(value) : g_strdup("");
/******************************************************************************
*****************************************************************************/
@@ -126,8 +54,6 @@
tag_class->get_prefix = gplate_variable_tag_class_get_prefix;
tag_class->get_suffix = gplate_variable_tag_class_get_suffix;
- tag_class->get_contents = gplate_variable_tag_get_contents;
/******************************************************************************