summaryrefslogtreecommitdiffstats
path: root/print/libgnomecups/files/patch-25_browsed_ppds
blob: 902eb029d01f943bc95886395983252c2b1c9630 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff -Nur libgnomecups-0.2.2/libgnomecups/gnome-cups-printer.c libgnomecups-0.2.2.new/libgnomecups/gnome-cups-printer.c
--- libgnomecups-0.2.2/libgnomecups/gnome-cups-printer.c    2006-09-18 10:23:13.000000000 +0200
+++ libgnomecups/gnome-cups-printer.c   2006-09-18 10:23:18.000000000 +0200
@@ -1105,7 +1105,7 @@
        return NULL;
    }
 
-   host = _gnome_cups_printer_get_host (printer);
+   host = _gnome_cups_printer_get_ppd_host (printer);
    ppdpath = get_ppd_uri_path (printer);
 
    gnome_cups_request_file (host, ppdpath, fd, &error);
@@ -1976,3 +1976,26 @@
    
    return host;
 }
+
+gchar *
+_gnome_cups_printer_get_ppd_host (GnomeCupsPrinter *printer)
+{
+   gchar *host = NULL;
+
+   if (printer->details->printer_uri) {
+       gchar *x, *y;
+
+       x = strstr (printer->details->printer_uri, "://");
+
+       if (x) {
+           x += 3;
+           y = strpbrk (x, ":/");
+           if (y)
+               host = g_strndup (x, y - x);
+           else 
+               host = g_strdup (x);
+       }
+   }
+   
+   return host;
+}
diff -Nur libgnomecups-0.2.2/libgnomecups/gnome-cups-printer.h libgnomecups-0.2.2.new/libgnomecups/gnome-cups-printer.h
--- libgnomecups-0.2.2/libgnomecups/gnome-cups-printer.h    2005-03-04 14:43:33.000000000 +0100
+++ libgnomecups/gnome-cups-printer.h   2006-09-18 10:23:18.000000000 +0200
@@ -184,6 +184,7 @@
 /* Private */
 void _gnome_cups_printer_init (void);
 gchar *_gnome_cups_printer_get_host (GnomeCupsPrinter *printer);
+gchar *_gnome_cups_printer_get_ppd_host (GnomeCupsPrinter *printer);
 
 G_END_DECLS