]> Pileus Git - ~andy/gtk/commitdiff
Simplify, make it build against cups 1.1. (#350329)
authorMatthias Clasen <mclasen@redhat.com>
Tue, 15 Aug 2006 16:05:13 +0000 (16:05 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 Aug 2006 16:05:13 +0000 (16:05 +0000)
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)

ChangeLog
ChangeLog.pre-2-10
modules/printbackends/cups/gtkprintbackendcups.c

index fb71fc7ea2c936dbf63d6376f4ab8ecfc313f023..0d134adb7cc2fa4fc06eda30d05d361a8b98810a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
 
index fb71fc7ea2c936dbf63d6376f4ab8ecfc313f023..0d134adb7cc2fa4fc06eda30d05d361a8b98810a 100644 (file)
@@ -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)
 
index 722dcb03427a885342e19c8ebba9161226dd4878..ac9193854eb99c1ec8c45cba5c39c304989fcda7 100644 (file)
@@ -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)
     {