diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 3 | ||||
-rw-r--r-- | modules/printbackends/cups/gtkprintbackendcups.c | 48 |
3 files changed, 22 insertions, 32 deletions
@@ -1,5 +1,8 @@ 2006-08-15 Matthias Clasen <mclasen@redhat.com> + * modules/printbackends/cups/gtkprintbackendcups.c (create_pickone_option): + Simplify, make it build against cups 1.1. (#350329) + * gtk/gtkliststore.c (gtk_list_store_insert_with_values): Fix a typo in the docs. (#349501, Carlos GUSLiBu) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fb71fc7ea2..0d134adb7c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2006-08-15 Matthias Clasen <mclasen@redhat.com> + * modules/printbackends/cups/gtkprintbackendcups.c (create_pickone_option): + Simplify, make it build against cups 1.1. (#350329) + * gtk/gtkliststore.c (gtk_list_store_insert_with_values): Fix a typo in the docs. (#349501, Carlos GUSLiBu) diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c index 722dcb0342..ac9193854e 100644 --- a/modules/printbackends/cups/gtkprintbackendcups.c +++ b/modules/printbackends/cups/gtkprintbackendcups.c @@ -1824,18 +1824,19 @@ available_choices (ppd_file_t *ppd, return option->num_choices - num_conflicts + add_auto; } -#if HAVE_CUPS_API_1_2 static GtkPrinterOption * -create_pickone_option_custom (ppd_file_t *ppd_file, - ppd_option_t *ppd_option, - ppd_coption_t *coption, - const gchar *gtk_name) +create_pickone_option (ppd_file_t *ppd_file, + ppd_option_t *ppd_option, + const gchar *gtk_name) { GtkPrinterOption *option; ppd_choice_t **available; char *label; int n_choices; int i; +#ifdef HAVE_CUPS_API_1_2 + ppd_coption_t *coption; +#endif g_assert (ppd_option->ui == PPD_UI_PICKONE); @@ -1844,15 +1845,20 @@ create_pickone_option_custom (ppd_file_t *ppd_file, n_choices = available_choices (ppd_file, ppd_option, &available, g_str_has_prefix (gtk_name, "gtk-")); if (n_choices > 0) { - ppd_cparam_t *cparam; - label = get_option_text (ppd_file, ppd_option); - /* right now only support one parameter per custom option * if more than one print warning and only offer the default choices */ + + label = get_option_text (ppd_file, ppd_option); + +#ifdef HAVE_CUPS_API_1_2 + coption = ppdFindCustomOption (ppd_file, ppd_option->keyword); + if (coption) { + ppd_cparam_t *cparam; + cparam = ppdFirstCustomParam (coption); if (ppdNextCustomParam (coption) == NULL) @@ -1893,6 +1899,7 @@ create_pickone_option_custom (ppd_file_t *ppd_file, else g_warning ("Not Supported: PPD Custom Option has more than one parameter"); } +#endif /* HAVE_CUPS_API_1_2 */ if (!option) option = gtk_printer_option_new (gtk_name, label, @@ -1924,19 +1931,6 @@ create_pickone_option_custom (ppd_file_t *ppd_file, return option; } -#endif /* HAVE_CUPS_API_1_2 */ - -static GtkPrinterOption * -create_pickone_option (ppd_file_t *ppd_file, - ppd_option_t *ppd_option, - const gchar *gtk_name) -{ - GtkPrinterOption *option; - - option = create_pickone_option_custom (ppd_file, ppd_option, NULL, gtk_name); - - return option; -} static GtkPrinterOption * create_boolean_option (ppd_file_t *ppd_file, @@ -2019,11 +2013,6 @@ handle_option (GtkPrinterOptionSet *set, GtkPrinterOption *option; char *name; -#ifdef HAVE_CUPS_API_1_2 - ppd_coption_t *coption = NULL; - coption = ppdFindCustomOption (ppd_file, ppd_option->keyword); -#endif - if (STRING_IN_TABLE (ppd_option->keyword, cups_option_blacklist)) return; @@ -2032,12 +2021,7 @@ handle_option (GtkPrinterOptionSet *set, option = NULL; if (ppd_option->ui == PPD_UI_PICKONE) { -#ifdef HAVE_CUPS_API_1_2 - if (coption) - option = create_pickone_option_custom (ppd_file, ppd_option, coption, name); - else -#endif - option = create_pickone_option (ppd_file, ppd_option, name); + option = create_pickone_option (ppd_file, ppd_option, name); } else if (ppd_option->ui == PPD_UI_BOOLEAN) { |