[glabels] Removed artifact of template aliases.
- From: Jim Evins <jimevins src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glabels] Removed artifact of template aliases.
- Date: Sat, 4 Dec 2010 12:50:28 +0000 (UTC)
commit 9f338207d5ec3a847a65d191c44e78055b3983df
Author: Jim Evins <evins snaught com>
Date: Sat Dec 4 07:49:35 2010 -0500
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 eac29e6..3c309d1 100644
--- a/libglabels/db.c
+++ b/libglabels/db.c
@@ -1713,55 +1713,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
* @paper_id: If non NULL, limit results to given page size.
@@ -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 c80d6b0..bcba326 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 941667f..5ee99eb 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]