[gimp] app: Print error message when tag cache parsing fails



commit a8e5dea3092bb487bf1268e486ad30b7416a274d
Author: Martin Nordholts <martinn src gnome org>
Date:   Tue Sep 8 08:38:51 2009 +0200

    app: Print error message when tag cache parsing fails

 app/core/gimptagcache.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/app/core/gimptagcache.c b/app/core/gimptagcache.c
index d13aa4a..a691ba2 100644
--- a/app/core/gimptagcache.c
+++ b/app/core/gimptagcache.c
@@ -460,16 +460,17 @@ gimp_tag_cache_load (GimpTagCache *cache)
   markup_parser.error         = gimp_tag_cache_load_error;
 
   xml_parser = gimp_xml_parser_new (&markup_parser, &parse_data);
-  if (! gimp_xml_parser_parse_file (xml_parser, filename, &error))
-    {
-      g_printerr ("Failed to parse tag cache.\n");
-    }
-  else
+  if (gimp_xml_parser_parse_file (xml_parser, filename, &error))
     {
       cache->priv->records = g_array_append_vals (cache->priv->records,
                                                   parse_data.records->data,
                                                   parse_data.records->len);
     }
+  else
+    {
+      g_printerr ("Failed to parse tag cache: %s\n",
+                  error ? error->message : NULL);
+    }
 
   g_free (filename);
   gimp_xml_parser_free (xml_parser);



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