From 9f338207d5ec3a847a65d191c44e78055b3983df Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sat, 4 Dec 2010 07:49:35 -0500 Subject: [PATCH] Removed artifact of template aliases. --- libglabels/db.c | 64 +++------------------------------ libglabels/db.h | 4 --- src/mini-preview-pixbuf-cache.c | 2 +- 3 files changed, 5 insertions(+), 65 deletions(-) diff --git a/libglabels/db.c b/libglabels/db.c index eac29e65..3c309d1c 100644 --- a/libglabels/db.c +++ b/libglabels/db.c @@ -1712,55 +1712,6 @@ lgl_db_does_template_name_exist (const gchar *name) } -/** - * lgl_db_get_template_name_list_unique: - * @brand: If non NULL, limit results to given brand - * @paper_id: If non NULL, limit results to given page size. - * @category_id: If non NULL, limit results to given template category. - * - * Get a list of valid names of unique templates in the template database. Results - * can be filtered by page size and/or template category. A list of valid page sizes - * can be obtained using lgl_db_get_paper_id_list(). A list of valid template categories - * can be obtained using lgl_db_get_category_id_list(). - * - * This function differs from lgl_db_get_template_name_list_all(), because it does not - * return multiple names for the same template. - * - * Returns: a list of template names. - */ -GList * -lgl_db_get_template_name_list_unique (const gchar *brand, - const gchar *paper_id, - const gchar *category_id) -{ - GList *p_tmplt; - lglTemplate *template; - gchar *name; - GList *names = NULL; - - if (!model) - { - lgl_db_init (); - } - - for (p_tmplt = model->templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) - { - template = (lglTemplate *) p_tmplt->data; - - if (lgl_template_does_brand_match (template, brand) && - lgl_template_does_page_size_match (template, paper_id) && - lgl_template_does_category_match (template, category_id)) - { - name = g_strdup_printf ("%s %s", template->brand, template->part); - names = g_list_insert_sorted (names, name, - (GCompareFunc)lgl_str_part_name_cmp); - } - } - - return names; -} - - /** * lgl_db_get_template_name_list_all: * @brand: If non NULL, limit results to given brand @@ -1772,9 +1723,6 @@ lgl_db_get_template_name_list_unique (const gchar *brand, * sizes can be obtained using lgl_db_get_paper_id_list(). A list of valid template * categories can be obtained using lgl_db_get_category_id_list(). * - * This function differs from lgl_db_get_template_name_list_unique(), because it will - * return multiple names for the same template. - * * Returns: a list of template names. */ GList * @@ -1795,16 +1743,12 @@ lgl_db_get_template_name_list_all (const gchar *brand, for (p_tmplt = model->templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) { template = (lglTemplate *) p_tmplt->data; - if (lgl_template_does_page_size_match (template, paper_id) && + if (lgl_template_does_brand_match (template, brand) && + lgl_template_does_page_size_match (template, paper_id) && lgl_template_does_category_match (template, category_id)) { - - if ( !brand || UTF8_EQUAL( template->brand, brand) ) - { - name = g_strdup_printf ("%s %s", template->brand, template->part); - names = g_list_insert_sorted (names, name, - (GCompareFunc)lgl_str_part_name_cmp); - } + name = g_strdup_printf ("%s %s", template->brand, template->part); + names = g_list_insert_sorted (names, name, (GCompareFunc)lgl_str_part_name_cmp); } } diff --git a/libglabels/db.h b/libglabels/db.h index c80d6b09..bcba326b 100644 --- a/libglabels/db.h +++ b/libglabels/db.h @@ -152,10 +152,6 @@ gboolean lgl_db_does_template_exist (const gchar *brand gboolean lgl_db_does_template_name_exist (const gchar *name); -GList *lgl_db_get_template_name_list_unique (const gchar *brand, - const gchar *paper_id, - const gchar *category_id); - GList *lgl_db_get_template_name_list_all (const gchar *brand, const gchar *paper_id, const gchar *category_id); diff --git a/src/mini-preview-pixbuf-cache.c b/src/mini-preview-pixbuf-cache.c index 941667f4..5ee99ebd 100644 --- a/src/mini-preview-pixbuf-cache.c +++ b/src/mini-preview-pixbuf-cache.c @@ -58,7 +58,7 @@ gl_mini_preview_pixbuf_cache_init (void) mini_preview_pixbuf_cache = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); - names = lgl_db_get_template_name_list_unique (NULL, NULL, NULL); + names = lgl_db_get_template_name_list_all (NULL, NULL, NULL); for ( p=names; p != NULL; p=p->next ) { gl_debug (DEBUG_PIXBUF_CACHE, "name = \"%s\"", p->data); -- 2.39.5