Bug 551378 - Print dialog: should try UDS when fetching PPD for localhost

2008-09-11  Marek Kasik  <mkasik@redhat.com>

	Bug 551378 - Print dialog: should try UDS when fetching PPD for
	localhost

	* modules/printbackends/cups/gtkprintbackendcups.c: Add ability
	to get PPD file from CUPS through Unix domain socket

svn path=/trunk/; revision=21345
This commit is contained in:
Marek Kasik 2008-09-11 08:47:56 +00:00 committed by Marek Kašík
parent 52153aef8a
commit 7c56db21d8
2 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2008-09-11 Marek Kasik <mkasik@redhat.com>
Bug 551378 - Print dialog: should try UDS when fetching PPD for
localhost
* modules/printbackends/cups/gtkprintbackendcups.c: Add ability
to get PPD file from CUPS through Unix domain socket
2008-09-11 Christian Dywan <christian@imendio.com>
Bug 551567 DND mark broken

View File

@ -1272,6 +1272,7 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
char hostname[HTTP_MAX_URI]; /* Hostname */
char resource[HTTP_MAX_URI]; /* Resource name */
int port; /* Port number */
char *cups_server; /* CUPS server */
list_has_changed = TRUE;
cups_printer = gtk_printer_cups_new (printer_name, backend);
@ -1318,9 +1319,20 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
}
gethostname (uri, sizeof (uri));
cups_server = g_strdup (cupsServer());
if (strcasecmp (uri, hostname) == 0)
strcpy (hostname, "localhost");
/* if the cups server is local and listening at a unix domain socket
* then use the socket connection
*/
if ((strstr (hostname, "localhost") != NULL) &&
(cups_server[0] == '/'))
strcpy (hostname, cups_server);
g_free (cups_server);
cups_printer->hostname = g_strdup (hostname);
cups_printer->port = port;