]> git.sur5r.net Git - glabels/commitdiff
2007-10-28 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Mon, 29 Oct 2007 01:47:08 +0000 (01:47 +0000)
committerJim Evins <evins@snaught.com>
Mon, 29 Oct 2007 01:47:08 +0000 (01:47 +0000)
* libglabels/xml-template.c:
Remove any leading white space from part #s when parsing old names.
* src/mini-preview-pixbuf-cache.c:
If name isn't in cache add it.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@688 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/ChangeLog
glabels2/libglabels/xml-template.c
glabels2/src/mini-preview-pixbuf-cache.c

index 10d816f5b09c48f4a21caac187c194c7d8d6656c..2b6e5fd18f6fff0cf7700964cbb867325a38dc99 100644 (file)
@@ -1,3 +1,10 @@
+2007-10-28  Jim Evins  <evins@snaught.com>
+
+       * libglabels/xml-template.c:
+               Remove any leading white space from part #s when parsing old names.
+       * src/mini-preview-pixbuf-cache.c:
+               If name isn't in cache add it.
+
 2007-10-26  Jim Evins  <evins@snaught.com>
 
        * libglabels/Makefile.am:
index 0d03e84133a1f0a12a5caa6adbd7d7ebfd8ec660..343fb7726d37d70ef3d576c54e4e4540b6984dcc 100644 (file)
@@ -215,17 +215,16 @@ lgl_xml_template_parse_template_node (const xmlNodePtr template_node)
                 name = lgl_xml_get_prop_string (template_node, "name", NULL);
                 if (name)
                 {
-                       g_message (_("Missing required \"brand\" or \"part\" attribute, trying deprecated name."));
                         v = g_strsplit (name, " ", 2);
                         brand = g_strdup (v[0]);
-                        part  = g_strdup (v[1]);
+                        part  = g_strchug (g_strdup (v[1]));
                         g_free (name);
                         g_strfreev (v);
                         
                 }
                 else
                 {
-                       g_message (_("Name attribute also missing."));
+                       g_message (_("Missing name or brand/part attributes."));
                 }
         }
 
index d5b53365b0dc5e545511018433fd073c96c8c231..5e5790f49bdf8bc61a381e8ee89e0d6c16979a10 100644 (file)
@@ -104,6 +104,12 @@ gl_mini_preview_pixbuf_cache_get_pixbuf (gchar      *name)
 
        pixbuf = g_hash_table_lookup (mini_preview_pixbuf_cache, name);
 
+        if (!pixbuf)
+        {
+                gl_mini_preview_pixbuf_cache_add_by_name (name);
+                pixbuf = g_hash_table_lookup (mini_preview_pixbuf_cache, name);
+        }
+
        gl_debug (DEBUG_PIXBUF_CACHE, "END");
 
        return g_object_ref (pixbuf);