Re: Speeding up the startup time of the print dialog (1/2)



On Tue, Aug 31, 2004 at 12:37:07PM -0400, Matthias Clasen wrote:
> On Fri, 2004-08-27 at 16:12, Matthias Clasen wrote:
> > Here is the first of two patches to address these issues. It is 
> > against libgnomecups and does the following:
> > 
> 
> The libgnomecups patch had a couple of problems which prevented
> it from working as intended. Here is an updated version.
 
> Index: libgnomecups/gnome-cups-printer.c
> ===================================================================
> RCS file: /cvs/gnome/libgnomecups/libgnomecups/gnome-cups-printer.c,v
> retrieving revision 1.26
> diff -u -r1.26 gnome-cups-printer.c
> --- libgnomecups/gnome-cups-printer.c	19 Aug 2004 20:46:19 -0000	1.26
> +++ libgnomecups/gnome-cups-printer.c	31 Aug 2004 16:34:04 -0000
> @@ -27,6 +27,8 @@
>  
>  #include <cups/cups.h>
>  #include <time.h>
> +#include <stdlib.h>
> +#include <ctype.h>
>  
>  #include "util.h"
>  #include "gnome-cups-request.h"
> @@ -323,6 +325,185 @@
>  	g_free (host);
>  }
>  
> +/*
> + * cups_get_dest() is copied from the cups libraries, file cups/dest.c,
> + * which is 
> + *   Copyright 1997-2004 by Easy Software Products.
Please add a comment that it is dual GPL LGPL

> +cups_get_dests
This is a alot of code to dup over but I agree that there's not alot
of choice.  We can live with it in libgnomecups.

> +parse_lpoptions (cups_dest_t **dests)
cups does alot of validation after getting the list checking for
stale entries.

>  GnomeCupsPrinter *
>  gnome_cups_printer_get (const char *printer_name)
>  {
> @@ -726,7 +881,7 @@
>  		printer_name = default_printer;
>  	}
>  
> -	if (!check_exists (printer_name)) {
> +	if (!name_in_list (printer_name, printer_names)) {
>  		return NULL;
>  	}
nice.

> +static char *
> +get_ppd_uri_path (GnomeCupsPrinter *printer)
> +{
> +	return g_strdup_printf ("/printers/%s.ppd", printer->details->printer_name);

It seems like we'd want to escape that name.

Please commit



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]