mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 19:30:10 +00:00
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:
parent
52153aef8a
commit
7c56db21d8
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user