From 85099bf6a64720a881e1897be21dca77765e78c3 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 17 Jan 2012 20:33:32 +0100 Subject: [PATCH] Strip "Custom." prefix when getting default options from cups. --- modules/printbackends/cups/gtkprintbackendcups.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c index 2751ee44ef..138bddd80d 100644 --- a/modules/printbackends/cups/gtkprintbackendcups.c +++ b/modules/printbackends/cups/gtkprintbackendcups.c @@ -3367,7 +3367,18 @@ create_pickone_option (ppd_file_t *ppd_file, option->choices_display[i] = get_choice_text (ppd_file, available[i]); } } - gtk_printer_option_set (option, ppd_option->defchoice); + + if (option->type != GTK_PRINTER_OPTION_TYPE_PICKONE) + { + if (g_str_has_prefix (ppd_option->defchoice, "Custom.")) + gtk_printer_option_set (option, ppd_option->defchoice + 7); + else + gtk_printer_option_set (option, ppd_option->defchoice); + } + else + { + gtk_printer_option_set (option, ppd_option->defchoice); + } } #ifdef PRINT_IGNORED_OPTIONS else