From 1843beacf1f7d4c2954fe21a60d8c95ce8dcec79 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Mon, 29 Oct 2007 01:47:08 +0000 Subject: [PATCH] 2007-10-28 Jim Evins * 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 | 7 +++++++ glabels2/libglabels/xml-template.c | 5 ++--- glabels2/src/mini-preview-pixbuf-cache.c | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 10d816f5..2b6e5fd1 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,10 @@ +2007-10-28 Jim Evins + + * 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 * libglabels/Makefile.am: diff --git a/glabels2/libglabels/xml-template.c b/glabels2/libglabels/xml-template.c index 0d03e841..343fb772 100644 --- a/glabels2/libglabels/xml-template.c +++ b/glabels2/libglabels/xml-template.c @@ -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.")); } } diff --git a/glabels2/src/mini-preview-pixbuf-cache.c b/glabels2/src/mini-preview-pixbuf-cache.c index d5b53365..5e5790f4 100644 --- a/glabels2/src/mini-preview-pixbuf-cache.c +++ b/glabels2/src/mini-preview-pixbuf-cache.c @@ -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); -- 2.39.5