replace the patch for the printing problem by the official upstream one, bump PKGREVdiff -r1.225 -r1.226 pkgsrc/x11/gtk2/Makefile
(drochner)
@@ -1,119 +1,120 @@ | @@ -1,119 +1,120 @@ | |||
1 | # $NetBSD: Makefile,v 1.225 2012/01/29 10:56:44 drochner Exp $ | 1 | # $NetBSD: Makefile,v 1.226 2012/02/01 18:23:04 drochner Exp $ | |
2 | 2 | |||
3 | DISTNAME= gtk+-2.24.9 | 3 | DISTNAME= gtk+-2.24.9 | |
4 | PKGNAME= ${DISTNAME:S/gtk/gtk2/} | 4 | PKGNAME= ${DISTNAME:S/gtk/gtk2/} | |
5 | PKGREVISION= 1 | |||
5 | CATEGORIES= x11 | 6 | CATEGORIES= x11 | |
6 | MASTER_SITES= ftp://ftp.gtk.org/pub/gtk/2.24/ \ | 7 | MASTER_SITES= ftp://ftp.gtk.org/pub/gtk/2.24/ \ | |
7 | ${MASTER_SITE_GNOME:=sources/gtk+/2.24/} | 8 | ${MASTER_SITE_GNOME:=sources/gtk+/2.24/} | |
8 | EXTRACT_SUFX= .tar.xz | 9 | EXTRACT_SUFX= .tar.xz | |
9 | 10 | |||
10 | MAINTAINER= pkgsrc-users@NetBSD.org | 11 | MAINTAINER= pkgsrc-users@NetBSD.org | |
11 | HOMEPAGE= http://www.gtk.org/ | 12 | HOMEPAGE= http://www.gtk.org/ | |
12 | COMMENT= GIMP Toolkit v2 - libraries for building X11 user interfaces | 13 | COMMENT= GIMP Toolkit v2 - libraries for building X11 user interfaces | |
13 | LICENSE= gnu-lgpl-v2.1 | 14 | LICENSE= gnu-lgpl-v2.1 | |
14 | 15 | |||
15 | # gtk-builder-convert uses minidom from xml.dom, which needs expat | 16 | # gtk-builder-convert uses minidom from xml.dom, which needs expat | |
16 | DEPENDS+= ${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat | 17 | DEPENDS+= ${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat | |
17 | 18 | |||
18 | PKG_DESTDIR_SUPPORT= user-destdir | 19 | PKG_DESTDIR_SUPPORT= user-destdir | |
19 | 20 | |||
20 | CONFLICTS= gtk2-engines<2.6.0 | 21 | CONFLICTS= gtk2-engines<2.6.0 | |
21 | CONFLICTS+= gail-[0-9]* | 22 | CONFLICTS+= gail-[0-9]* | |
22 | 23 | |||
23 | SUPERSEDES= gail-[0-9]* | 24 | SUPERSEDES= gail-[0-9]* | |
24 | 25 | |||
25 | USE_PKGLOCALEDIR= yes | 26 | USE_PKGLOCALEDIR= yes | |
26 | USE_TOOLS+= gmake msgfmt perl pkg-config | 27 | USE_TOOLS+= gmake msgfmt perl pkg-config | |
27 | USE_LANGUAGES= c c++ | 28 | USE_LANGUAGES= c c++ | |
28 | USE_LIBTOOL= yes | 29 | USE_LIBTOOL= yes | |
29 | PTHREAD_AUTO_VARS= yes | 30 | PTHREAD_AUTO_VARS= yes | |
30 | 31 | |||
31 | GNU_CONFIGURE= yes | 32 | GNU_CONFIGURE= yes | |
32 | # bashism in "configure" (illegal variable substitution), patched | 33 | # bashism in "configure" (illegal variable substitution), patched | |
33 | #CONFIG_SHELL= bash | 34 | #CONFIG_SHELL= bash | |
34 | CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/libdata | 35 | CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/libdata | |
35 | # Work around build problems, disable unstable PAPI, PR #41608: | 36 | # Work around build problems, disable unstable PAPI, PR #41608: | |
36 | CONFIGURE_ARGS+= --disable-papi | 37 | CONFIGURE_ARGS+= --disable-papi | |
37 | # Not to unwanted pick up of db2html, PR#44908 | 38 | # Not to unwanted pick up of db2html, PR#44908 | |
38 | CONFIGURE_ENV+= ac_cv_prog_DB2HTML=false | 39 | CONFIGURE_ENV+= ac_cv_prog_DB2HTML=false | |
39 | MAKE_ENV+= PKGLOCALEDIR=${PKGLOCALEDIR} | 40 | MAKE_ENV+= PKGLOCALEDIR=${PKGLOCALEDIR} | |
40 | TEST_TARGET= check | 41 | TEST_TARGET= check | |
41 | 42 | |||
42 | PKGCONFIG_OVERRIDE= gdk-2.0-uninstalled.pc.in | 43 | PKGCONFIG_OVERRIDE= gdk-2.0-uninstalled.pc.in | |
43 | PKGCONFIG_OVERRIDE+= gdk-2.0.pc.in | 44 | PKGCONFIG_OVERRIDE+= gdk-2.0.pc.in | |
44 | PKGCONFIG_OVERRIDE+= gtk+-2.0-uninstalled.pc.in | 45 | PKGCONFIG_OVERRIDE+= gtk+-2.0-uninstalled.pc.in | |
45 | PKGCONFIG_OVERRIDE+= gtk+-2.0.pc.in | 46 | PKGCONFIG_OVERRIDE+= gtk+-2.0.pc.in | |
46 | PKGCONFIG_OVERRIDE+= gtk+-unix-print-2.0.pc.in | 47 | PKGCONFIG_OVERRIDE+= gtk+-unix-print-2.0.pc.in | |
47 | #PKGCONFIG_OVERRIDE+= gdk-pixbuf-2.0-uninstalled.pc.in | 48 | #PKGCONFIG_OVERRIDE+= gdk-pixbuf-2.0-uninstalled.pc.in | |
48 | #PKGCONFIG_OVERRIDE+= gdk-pixbuf-2.0.pc.in | 49 | #PKGCONFIG_OVERRIDE+= gdk-pixbuf-2.0.pc.in | |
49 | #PKGCONFIG_OVERRIDE+= contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc.in | 50 | #PKGCONFIG_OVERRIDE+= contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc.in | |
50 | 51 | |||
51 | INSTALLATION_DIRS+= lib/gtk-2.0/immodules | 52 | INSTALLATION_DIRS+= lib/gtk-2.0/immodules | |
52 | INSTALLATION_DIRS+= lib/gtk-2.0/modules | 53 | INSTALLATION_DIRS+= lib/gtk-2.0/modules | |
53 | INSTALLATION_DIRS+= lib/gtk-2.0/2.10.0/filesystems | 54 | INSTALLATION_DIRS+= lib/gtk-2.0/2.10.0/filesystems | |
54 | 55 | |||
55 | REQD_DIRS+= ${PREFIX}/libdata/gtk-2.0 | 56 | REQD_DIRS+= ${PREFIX}/libdata/gtk-2.0 | |
56 | 57 | |||
57 | BUILD_DIRS= . demos/gtk-demo | 58 | BUILD_DIRS= . demos/gtk-demo | |
58 | 59 | |||
59 | .include "../../mk/bsd.prefs.mk" | 60 | .include "../../mk/bsd.prefs.mk" | |
60 | 61 | |||
61 | # fix for 'only weak aliases are supported on darwin' error | 62 | # fix for 'only weak aliases are supported on darwin' error | |
62 | .if ${OPSYS} == "Darwin" | 63 | .if ${OPSYS} == "Darwin" | |
63 | CONFIGURE_ARGS+= --disable-visibility | 64 | CONFIGURE_ARGS+= --disable-visibility | |
64 | .endif | 65 | .endif | |
65 | 66 | |||
66 | # gtk/Makefile.am hardcodes 'grep -o' so require GNU grep on platforms | 67 | # gtk/Makefile.am hardcodes 'grep -o' so require GNU grep on platforms | |
67 | # which do not have it. | 68 | # which do not have it. | |
68 | .if ${OPSYS} == "SunOS" | 69 | .if ${OPSYS} == "SunOS" | |
69 | BUILD_DEPENDS+= grep-[0-9]*:../../textproc/grep | 70 | BUILD_DEPENDS+= grep-[0-9]*:../../textproc/grep | |
70 | TOOLS_PATH.grep= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}grep | 71 | TOOLS_PATH.grep= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}grep | |
71 | .endif | 72 | .endif | |
72 | 73 | |||
73 | CPPFLAGS+= -DPREFIX="\"${PREFIX}\"" | 74 | CPPFLAGS+= -DPREFIX="\"${PREFIX}\"" | |
74 | 75 | |||
75 | #SUBST_CLASSES+= pthread | 76 | #SUBST_CLASSES+= pthread | |
76 | #SUBST_STAGE.pthread= pre-configure | 77 | #SUBST_STAGE.pthread= pre-configure | |
77 | #SUBST_MESSAGE.pthread= Fixing pthread flags. | 78 | #SUBST_MESSAGE.pthread= Fixing pthread flags. | |
78 | #SUBST_SED.pthread= -e 's,__PTHREAD_FLAGS__,${BUILDLINK_LDFLAGS.pthread},g' | 79 | #SUBST_SED.pthread= -e 's,__PTHREAD_FLAGS__,${BUILDLINK_LDFLAGS.pthread},g' | |
79 | #SUBST_FILES.pthread= gdk-pixbuf/Makefile.in | 80 | #SUBST_FILES.pthread= gdk-pixbuf/Makefile.in | |
80 | 81 | |||
81 | PYTHON_PATCH_SCRIPTS= gtk/gtk-builder-convert | 82 | PYTHON_PATCH_SCRIPTS= gtk/gtk-builder-convert | |
82 | 83 | |||
83 | # We remove the module databases during post-install since we create them | 84 | # We remove the module databases during post-install since we create them | |
84 | # anew in the +INSTALL script as part of the POST-INSTALL action. | 85 | # anew in the +INSTALL script as part of the POST-INSTALL action. | |
85 | # | 86 | # | |
86 | post-install: | 87 | post-install: | |
87 | ${RM} -f ${DESTDIR}${GTK_IMMODULES_DB} | 88 | ${RM} -f ${DESTDIR}${GTK_IMMODULES_DB} | |
88 | 89 | |||
89 | EVAL_PREFIX+= PREFIX.hicolor=hicolor-icon-theme | 90 | EVAL_PREFIX+= PREFIX.hicolor=hicolor-icon-theme | |
90 | FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${PREFIX}/bin/gtk-update-icon-cache" | 91 | FILES_SUBST+= GTK_UPDATE_ICON_CACHE="${PREFIX}/bin/gtk-update-icon-cache" | |
91 | FILES_SUBST+= ICON_THEME_DIR="${PREFIX.hicolor}/share/icons/hicolor" | 92 | FILES_SUBST+= ICON_THEME_DIR="${PREFIX.hicolor}/share/icons/hicolor" | |
92 | INSTALL_TEMPLATES+= ../../x11/gtk2/files/icon-cache.tmpl | 93 | INSTALL_TEMPLATES+= ../../x11/gtk2/files/icon-cache.tmpl | |
93 | PRINT_PLIST_AWK+= /^share\/icons\/hicolor\/icon-theme.cache$$/ { next; } | 94 | PRINT_PLIST_AWK+= /^share\/icons\/hicolor\/icon-theme.cache$$/ { next; } | |
94 | 95 | |||
95 | _BUILDING_GTK2= yes | 96 | _BUILDING_GTK2= yes | |
96 | .include "modules.mk" | 97 | .include "modules.mk" | |
97 | 98 | |||
98 | .include "../../databases/shared-mime-info/buildlink3.mk" | 99 | .include "../../databases/shared-mime-info/buildlink3.mk" | |
99 | BUILDLINK_API_DEPENDS.atk+= atk>=1.30.0 | 100 | BUILDLINK_API_DEPENDS.atk+= atk>=1.30.0 | |
100 | .include "../../devel/atk/buildlink3.mk" | 101 | .include "../../devel/atk/buildlink3.mk" | |
101 | .include "../../devel/gettext-lib/buildlink3.mk" | 102 | .include "../../devel/gettext-lib/buildlink3.mk" | |
102 | BUILDLINK_API_DEPENDS.glib2+= glib2>=2.28.0 | 103 | BUILDLINK_API_DEPENDS.glib2+= glib2>=2.28.0 | |
103 | .include "../../devel/glib2/buildlink3.mk" | 104 | .include "../../devel/glib2/buildlink3.mk" | |
104 | .include "../../graphics/gdk-pixbuf2/buildlink3.mk" | 105 | .include "../../graphics/gdk-pixbuf2/buildlink3.mk" | |
105 | 106 | |||
106 | .include "options.mk" | 107 | .include "options.mk" | |
107 | 108 | |||
108 | BUILDLINK_API_DEPENDS.pango+= pango>=1.20.0 | 109 | BUILDLINK_API_DEPENDS.pango+= pango>=1.20.0 | |
109 | .include "../../devel/pango/buildlink3.mk" | 110 | .include "../../devel/pango/buildlink3.mk" | |
110 | .include "../../fonts/fontconfig/buildlink3.mk" | 111 | .include "../../fonts/fontconfig/buildlink3.mk" | |
111 | BUILDLINK_API_DEPENDS.cairo+= cairo>=1.6.0 | 112 | BUILDLINK_API_DEPENDS.cairo+= cairo>=1.6.0 | |
112 | .include "../../graphics/cairo/buildlink3.mk" | 113 | .include "../../graphics/cairo/buildlink3.mk" | |
113 | .include "../../graphics/freetype2/buildlink3.mk" | 114 | .include "../../graphics/freetype2/buildlink3.mk" | |
114 | #.include "../../mk/jpeg.buildlink3.mk" | 115 | #.include "../../mk/jpeg.buildlink3.mk" | |
115 | #.include "../../graphics/png/buildlink3.mk" | 116 | #.include "../../graphics/png/buildlink3.mk" | |
116 | #.include "../../graphics/tiff/buildlink3.mk" | 117 | #.include "../../graphics/tiff/buildlink3.mk" | |
117 | .include "../../lang/python/application.mk" | 118 | .include "../../lang/python/application.mk" | |
118 | 119 | |||
119 | .include "../../mk/bsd.pkg.mk" | 120 | .include "../../mk/bsd.pkg.mk" |
@@ -1,10 +1,10 @@ | @@ -1,10 +1,10 @@ | |||
1 | $NetBSD: distinfo,v 1.140 2012/01/29 10:56:44 drochner Exp $ | 1 | $NetBSD: distinfo,v 1.141 2012/02/01 18:23:04 drochner Exp $ | |
2 | 2 | |||
3 | SHA1 (gtk+-2.24.9.tar.xz) = 7760411a8ee50a1e01e4480e074f9f221f0884db | 3 | SHA1 (gtk+-2.24.9.tar.xz) = 7760411a8ee50a1e01e4480e074f9f221f0884db | |
4 | RMD160 (gtk+-2.24.9.tar.xz) = 4e51be9955a9f3d359fcaca9cc30c12477789d28 | 4 | RMD160 (gtk+-2.24.9.tar.xz) = 4e51be9955a9f3d359fcaca9cc30c12477789d28 | |
5 | Size (gtk+-2.24.9.tar.xz) = 13200580 bytes | 5 | Size (gtk+-2.24.9.tar.xz) = 13200580 bytes | |
6 | SHA1 (patch-aa) = 9eec7fc4764b18856455a18b49f1bb101e5e6b11 | 6 | SHA1 (patch-aa) = 9eec7fc4764b18856455a18b49f1bb101e5e6b11 | |
7 | SHA1 (patch-ab) = 9c82cc60f3825d377a197c876fcc6faa379cbde3 | 7 | SHA1 (patch-ab) = 9c82cc60f3825d377a197c876fcc6faa379cbde3 | |
8 | SHA1 (patch-af) = d59414e24a7da7f8694dbefbd2f0c2c2b60ec5ad | 8 | SHA1 (patch-af) = d59414e24a7da7f8694dbefbd2f0c2c2b60ec5ad | |
9 | SHA1 (patch-aj) = 9887573ac7ade9e8f8ee2ead68e279f67836a1a3 | 9 | SHA1 (patch-aj) = 9887573ac7ade9e8f8ee2ead68e279f67836a1a3 | |
10 | SHA1 (patch-ak) = 4f9badd2b5607c94c8ccb5c22d60a87105cc1ae3 | 10 | SHA1 (patch-ak) = 90c49bf6b7bf79bb8ad270c2661876ea7b0cb5ad |
@@ -1,97 +1,126 @@ | @@ -1,97 +1,126 @@ | |||
1 | $NetBSD: patch-ak,v 1.5 2012/01/29 10:56:44 drochner Exp $ | 1 | $NetBSD: patch-ak,v 1.6 2012/02/01 18:23:05 drochner Exp $ | |
2 | 2 | |||
3 | revert upstream commit 8170436e61ea68c713d75ad374d22c3261be9203, | 3 | gnome bug #543520 | |
4 | it causes firefox crashes (see gnome bug #543520) | |||
5 | 4 | |||
6 | --- modules/printbackends/cups/gtkprintbackendcups.c.orig 2012-01-24 19:38:37.000000000 +0000 | 5 | --- modules/printbackends/cups/gtkprintbackendcups.c.orig 2012-01-24 19:38:37.000000000 +0000 | |
7 | +++ modules/printbackends/cups/gtkprintbackendcups.c | 6 | +++ modules/printbackends/cups/gtkprintbackendcups.c | |
8 | @@ -483,44 +483,22 @@ cups_print_cb (GtkPrintBackendCups *prin | 7 | @@ -485,7 +485,7 @@ cups_print_cb (GtkPrintBackendCups *prin | |
9 | GDK_THREADS_LEAVE (); | |||
10 | } | |||
11 | 8 | |||
12 | -typedef struct { | 9 | typedef struct { | |
13 | - GtkCupsRequest *request; | 10 | GtkCupsRequest *request; | |
14 | - GtkPrinterOptionSet *options; | 11 | - GtkPrinterOptionSet *options; | |
15 | -} CupsOptionsData; | 12 | + GtkPrinterCups *printer; | |
16 | - | 13 | } CupsOptionsData; | |
14 | ||||
17 | static void | 15 | static void | |
18 | add_cups_options (const gchar *key, | 16 | @@ -495,9 +495,13 @@ add_cups_options (const gchar *key, | |
19 | const gchar *value, | |||
20 | gpointer user_data) | |||
21 | { | 17 | { | |
22 | - CupsOptionsData *data = (CupsOptionsData *) user_data; | 18 | CupsOptionsData *data = (CupsOptionsData *) user_data; | |
23 | - GtkCupsRequest *request = data->request; | 19 | GtkCupsRequest *request = data->request; | |
24 | - GtkPrinterOptionSet *options = data->options; | 20 | - GtkPrinterOptionSet *options = data->options; | |
25 | - GtkPrinterOption *option = NULL; | 21 | - GtkPrinterOption *option = NULL; | |
26 | - gchar *new_value = NULL; | 22 | + GtkPrinterCups *printer = data->printer; | |
27 | + GtkCupsRequest *request = user_data; | 23 | + gboolean custom_value = FALSE; | |
24 | gchar *new_value = NULL; | |||
25 | + gint i; | |||
26 | + | |||
27 | + if (!key || !value) | |||
28 | + return; | |||
28 | 29 | |||
29 | if (!g_str_has_prefix (key, "cups-")) | 30 | if (!g_str_has_prefix (key, "cups-")) | |
30 | return; | 31 | return; | |
31 | 32 | @@ -505,17 +509,37 @@ add_cups_options (const gchar *key, | ||
32 | if (strcmp (value, "gtk-ignore-value") == 0) | 33 | if (strcmp (value, "gtk-ignore-value") == 0) | |
33 | return; | 34 | return; | |
34 | - | 35 | ||
35 | - option = gtk_printer_option_set_lookup (options, key); | 36 | - option = gtk_printer_option_set_lookup (options, key); | |
36 | 37 | - | ||
37 | key = key + strlen ("cups-"); | 38 | key = key + strlen ("cups-"); | |
38 | 39 | |||
39 | - /* Add "Custom." prefix to custom values */ | 40 | - /* Add "Custom." prefix to custom values */ | |
40 | - if (value && option && | 41 | - if (value && option && | |
41 | - !gtk_printer_option_has_choice (option, value)) | 42 | - !gtk_printer_option_has_choice (option, value)) | |
42 | - new_value = g_strdup_printf ("Custom.%s", value); | 43 | - new_value = g_strdup_printf ("Custom.%s", value); | |
43 | - | 44 | + if (printer && printer->ppd_file) | |
44 | - if (new_value) | 45 | + { | |
45 | - { | 46 | + ppd_coption_t *coption; | |
46 | - gtk_cups_request_encode_option (request, key, new_value); | 47 | + gboolean found = FALSE; | |
47 | - g_free (new_value); | 48 | + gboolean custom_values_enabled = FALSE; | |
48 | - } | 49 | + | |
49 | - else | 50 | + coption = ppdFindCustomOption (printer->ppd_file, key); | |
50 | - gtk_cups_request_encode_option (request, key, value); | 51 | + if (coption && coption->option) | |
51 | + gtk_cups_request_encode_option (request, key, value); | 52 | + { | |
52 | } | 53 | + for (i = 0; i < coption->option->num_choices; i++) | |
54 | + { | |||
55 | + /* Are custom values enabled ? */ | |||
56 | + if (g_str_equal (coption->option->choices[i].choice, "Custom")) | |||
57 | + custom_values_enabled = TRUE; | |||
58 | + | |||
59 | + /* Is the value among available choices ? */ | |||
60 | + if (g_str_equal (coption->option->choices[i].choice, value)) | |||
61 | + found = TRUE; | |||
62 | + } | |||
63 | + | |||
64 | + if (custom_values_enabled && !found) | |||
65 | + custom_value = TRUE; | |||
66 | + } | |||
67 | + } | |||
53 | 68 | |||
54 | static void | 69 | - if (new_value) | |
55 | @@ -533,12 +511,8 @@ gtk_print_backend_cups_print_stream (Gtk | 70 | + /* Add "Custom." prefix to custom values. */ | |
56 | { | 71 | + if (custom_value) | |
57 | GtkPrinterCups *cups_printer; | 72 | { | |
58 | CupsPrintStreamData *ps; | 73 | + new_value = g_strdup_printf ("Custom.%s", value); | |
59 | - CupsOptionsData *options_data; | 74 | gtk_cups_request_encode_option (request, key, new_value); | |
75 | g_free (new_value); | |||
76 | } | |||
77 | @@ -536,9 +560,6 @@ gtk_print_backend_cups_print_stream (Gtk | |||
78 | CupsOptionsData *options_data; | |||
60 | GtkCupsRequest *request; | 79 | GtkCupsRequest *request; | |
61 | GtkPrintSettings *settings; | 80 | GtkPrintSettings *settings; | |
62 | - GtkPrinterOptionSet *options; | 81 | - GtkPrinterOptionSet *options; | |
63 | - GtkPrintCapabilities capabilities; | 82 | - GtkPrintCapabilities capabilities; | |
64 | - GtkPageSetup *page_setup; | 83 | - GtkPageSetup *page_setup; | |
65 | const gchar *title; | 84 | const gchar *title; | |
66 | char printer_absolute_uri[HTTP_MAX_URI]; | 85 | char printer_absolute_uri[HTTP_MAX_URI]; | |
67 | 86 | |||
68 | @@ -547,8 +521,6 @@ gtk_print_backend_cups_print_stream (Gtk | 87 | @@ -547,8 +568,6 @@ gtk_print_backend_cups_print_stream (Gtk | |
69 | 88 | |||
70 | cups_printer = GTK_PRINTER_CUPS (gtk_print_job_get_printer (job)); | 89 | cups_printer = GTK_PRINTER_CUPS (gtk_print_job_get_printer (job)); | |
71 | settings = gtk_print_job_get_settings (job); | 90 | settings = gtk_print_job_get_settings (job); | |
72 | - capabilities = cups_printer_get_capabilities (GTK_PRINTER (cups_printer)); | 91 | - capabilities = cups_printer_get_capabilities (GTK_PRINTER (cups_printer)); | |
73 | - page_setup = gtk_printer_get_default_page_size (GTK_PRINTER (cups_printer)); | 92 | - page_setup = gtk_printer_get_default_page_size (GTK_PRINTER (cups_printer)); | |
74 | 93 | |||
75 | request = gtk_cups_request_new_with_username (NULL, | 94 | request = gtk_cups_request_new_with_username (NULL, | |
76 | GTK_CUPS_POST, | 95 | GTK_CUPS_POST, | |
77 | @@ -586,18 +558,8 @@ gtk_print_backend_cups_print_stream (Gtk | 96 | @@ -586,16 +605,10 @@ gtk_print_backend_cups_print_stream (Gtk | |
78 | IPP_TAG_NAME, "job-name", | 97 | IPP_TAG_NAME, "job-name", | |
79 | NULL, title); | 98 | NULL, title); | |
80 | 99 | |||
81 | - options = cups_printer_get_options (GTK_PRINTER (cups_printer), settings, page_setup, capabilities); | 100 | - options = cups_printer_get_options (GTK_PRINTER (cups_printer), settings, page_setup, capabilities); | |
82 | - | 101 | - | |
83 | - options_data = g_new0 (CupsOptionsData, 1); | 102 | options_data = g_new0 (CupsOptionsData, 1); | |
84 | - options_data->request = request; | 103 | options_data->request = request; | |
85 | - options_data->options = options; | 104 | - options_data->options = options; | |
86 | - | 105 | - | |
87 | - gtk_print_settings_foreach (settings, add_cups_options, options_data); | 106 | + options_data->printer = cups_printer; | |
107 | gtk_print_settings_foreach (settings, add_cups_options, options_data); | |||
88 | - | 108 | - | |
89 | - g_object_unref (page_setup); | 109 | - g_object_unref (page_setup); | |
90 | - g_object_unref (options); | 110 | - g_object_unref (options); | |
91 | - g_free (options_data); | 111 | g_free (options_data); | |
92 | - | 112 | ||
93 | + gtk_print_settings_foreach (settings, add_cups_options, request); | |||
94 | + | |||
95 | ps = g_new0 (CupsPrintStreamData, 1); | 113 | ps = g_new0 (CupsPrintStreamData, 1); | |
96 | ps->callback = callback; | 114 | @@ -4606,7 +4619,12 @@ cups_printer_get_default_page_size (GtkP | |
97 | ps->user_data = user_data; | 115 | return NULL; | |
116 | ||||
117 | option = ppdFindOption (ppd_file, "PageSize"); | |||
118 | + if (option == NULL) | |||
119 | + return NULL; | |||
120 | + | |||
121 | size = ppdPageSize (ppd_file, option->defchoice); | |||
122 | + if (size == NULL) | |||
123 | + return NULL; | |||
124 | ||||
125 | return create_page_setup (ppd_file, size); | |||
126 | } |