[gtk+/gtk-3-2] Strip "Custom." prefix when getting default options from cups.
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-2] Strip "Custom." prefix when getting default options from cups.
- Date: Mon, 12 Mar 2012 02:56:50 +0000 (UTC)
commit cdf116605fe79af2e6da49a55ff266757bb0c2f3
Author: Benjamin Berg <benjamin sipsolutions net>
Date: Tue Jan 17 20:33:32 2012 +0100
Strip "Custom." prefix when getting default options from cups.
modules/printbackends/cups/gtkprintbackendcups.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 48dec9d..4ce8eb3 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -3345,7 +3345,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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]