gimp r26316 - in branches/soc-2008-tagging: . app/core



Author: aurisj
Date: Sat Jul 26 13:36:28 2008
New Revision: 26316
URL: http://svn.gnome.org/viewvc/gimp?rev=26316&view=rev

Log:
2008-07-26  Aurimas JuÅka  <aurisj svn gnome org>

	* app/core/gimptagcache.c (gimp_tag_cache_save): escape identifiers
	and tags when saving to cache.



Modified:
   branches/soc-2008-tagging/ChangeLog
   branches/soc-2008-tagging/app/core/gimptagcache.c

Modified: branches/soc-2008-tagging/app/core/gimptagcache.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimptagcache.c	(original)
+++ branches/soc-2008-tagging/app/core/gimptagcache.c	Sat Jul 26 13:36:28 2008
@@ -35,6 +35,7 @@
 #include "gimp.h"
 #include "gimpcontext.h"
 #include "gimpdata.h"
+#include "gimptag.h"
 #include "gimptagcache.h"
 #include "gimplist.h"
 #include "gimp-utils.h"
@@ -330,18 +331,26 @@
     {
       GimpTagCacheRecord *cache_rec = (GimpTagCacheRecord*) iterator->data;
       GList              *tag_iterator;
+      gchar              *identifier_string;
+      gchar              *tag_string;
 
+      identifier_string = g_markup_escape_text (g_quark_to_string (cache_rec->identifier), -1);
       g_string_append_printf (buf, "\t<resource identifier=\"%s\" checksum=\"%s\">\n",
-                              g_quark_to_string (cache_rec->identifier),
+                              identifier_string,
                               g_quark_to_string (cache_rec->checksum));
+      g_free (identifier_string);
+
       tag_iterator = cache_rec->tags;
       while (tag_iterator)
         {
-          g_string_append_printf (buf, "\t\t<tag>%s</tag>\n",
-                                  g_quark_to_string (GPOINTER_TO_UINT (tag_iterator->data)));
+          tag_string = g_markup_escape_text (gimp_tag_to_string (GPOINTER_TO_UINT (tag_iterator->data)), -1);
+          g_string_append_printf (buf, "\t\t<tag>%s</tag>\n", tag_string);
+          g_free (tag_string);
           tag_iterator = g_list_next (tag_iterator);
         }
       g_string_append (buf, "\t</resource>\n");
+
+
       iterator = g_list_next (iterator);
     }
   g_string_append (buf, "</tag_cache>\n");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]