Colin Walters | 3 Aug 2004 19:37
Picon
Favicon

[patch] some threading fixes, and handle no default printers

Hi,

Attached is a patch to libgnomeprintui which adds some GDK_THREADS_ENTER
calls to callbacks eventually run from the libgnomecups idle handlers.  

More importantly for most applications, this also fixes the case where
there is no default printer (this part of the patch is from Matthias).

Ok to apply?

_______________________________________________
gnome-print-list mailing list
gnome-print-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-print-list
Jody Goldberg | 9 Aug 2004 19:55
Picon

Re: [patch] don't poll individual jobs

On Fri, Jul 30, 2004 at 01:25:38PM -0400, Colin Walters wrote:
> Hi,
> 
> The attached patch causes libgnomeprint to not instantiate
> GnomeCupsQueue objects.  These were simply used to get the number of
> jobs, which is much more efficiently done by simply getting the queued-
> job-count from the attributes update.
> 
> Ok to apply?

Please.
Colin Walters | 11 Aug 2004 17:29
Picon
Favicon

[patch] notification for printer deletions

Hi,

Here is a patch by Matthias and I which allows one to receive
notifications when printers go away, without holding a reference
to every printer object (and thus polling their state).
_______________________________________________
gnome-print-list mailing list
gnome-print-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-print-list
Jody Goldberg | 11 Aug 2004 17:43
Picon

Re: [patch] notification for printer deletions

On Wed, Aug 11, 2004 at 11:29:43AM -0400, Colin Walters wrote:
> Hi,
> 
> Here is a patch by Matthias and I which allows one to receive
> notifications when printers go away, without holding a reference
> to every printer object (and thus polling their state).

Good idea.  Please commit
Colin Walters | 11 Aug 2004 19:31
Picon
Favicon

Re: [patch] don't poll individual jobs

On Mon, 2004-08-09 at 13:55 -0400, Jody Goldberg wrote:
> On Fri, Jul 30, 2004 at 01:25:38PM -0400, Colin Walters wrote:
> > Hi,
> > 
> > The attached patch causes libgnomeprint to not instantiate
> > GnomeCupsQueue objects.  These were simply used to get the number of
> > jobs, which is much more efficiently done by simply getting the queued-
> > job-count from the attributes update.
> > 
> > Ok to apply?
> 
> Please.

Done, thanks!

_______________________________________________
gnome-print-list mailing list
gnome-print-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-print-list
Colin Walters | 11 Aug 2004 19:31
Picon
Favicon

Re: [patch] notification for printer deletions

On Wed, 2004-08-11 at 11:43 -0400, Jody Goldberg wrote:
> On Wed, Aug 11, 2004 at 11:29:43AM -0400, Colin Walters wrote:
> > Hi,
> > 
> > Here is a patch by Matthias and I which allows one to receive
> > notifications when printers go away, without holding a reference
> > to every printer object (and thus polling their state).
> 
> Good idea.  Please commit

Done, thanks!

_______________________________________________
gnome-print-list mailing list
gnome-print-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-print-list
Colin Walters | 13 Aug 2004 01:03
Picon
Favicon

[patch] fix libgnomecups attribute settings

Hi,

Since retrieval of printer attributes when gnome_cups_printer_get is
called is now asynchronous, this poses a problem - callers don't know
when the attributes (description, URI, etc) are valid.

The attached patch adds an API method to know when the attributes have
been set for the first time.  What we do inside eggcups when a new
printer is detected is call gnome_cups_printer_get, attach to its
attributes-changed callback, and at that point we know the attributes
are valid (in particular the URI).  The new method
gnome_cups_printer_get_attributes_initialized is used for sanity checks.

This patch also changes the API for gnome_cups_request_new_for_printer.
It used to take a printer name, but we've changed it to take a real
GnomeCupsPrinter object, since that's the only way we can discover the
URI for the printer.  I'm pretty sure this is the right change because
it simplifies all of the callers.

I'm not sure if there are even any external callers of
gnome_cups_request_new_for_printer, so the API change shouldn't be a
problem.

We also moved gnome_cups_get_printer_uri back into utils.c, where it
makes more sense now I think.

_______________________________________________
(Continue reading)

Jody Goldberg | 13 Aug 2004 21:18
Picon

Re: [patch] some threading fixes, and handle no default printers

On Tue, Aug 03, 2004 at 01:37:41PM -0400, Colin Walters wrote:
> Hi,
> 
> Attached is a patch to libgnomeprintui which adds some
> GDK_THREADS_ENTER
> calls to callbacks eventually run from the libgnomecups idle
> handlers.  

Putting the threading checks in the gpaui code where there are no
obvious threads is certainly simple, but seems out of place.  I'd
rather they be down in the only threaded backend
    libgnomeprint/libgnomeprint/modules/cups/gnome-print-cups.c
which keeps knowledge of threads local.

> More importantly for most applications, this also fixes the
> case where
> there is no default printer (this part of the patch is from
> Matthias).
Blah I've had something similar sitting in my tree for a while, and
forgot to commit.
Jody Goldberg | 13 Aug 2004 21:23
Picon

Re: [patch] fix libgnomecups attribute settings

On Thu, Aug 12, 2004 at 07:03:02PM -0400, Colin Walters wrote:
> Hi,
> 
> Since retrieval of printer attributes when gnome_cups_printer_get is
> called is now asynchronous, this poses a problem - callers don't know
> when the attributes (description, URI, etc) are valid.
> 
> The attached patch adds an API method to know when the attributes have
> been set for the first time.  What we do inside eggcups when a new
> printer is detected is call gnome_cups_printer_get, attach to its
> attributes-changed callback, and at that point we know the attributes
> are valid (in particular the URI).

Do we want something like that in gnomeprint too ?

> This patch also changes the API for gnome_cups_request_new_for_printer.
> It used to take a printer name, but we've changed it to take a real
> GnomeCupsPrinter object, since that's the only way we can discover the
> URI for the printer.  I'm pretty sure this is the right change because
> it simplifies all of the callers.
> 
> I'm not sure if there are even any external callers of
> gnome_cups_request_new_for_printer, so the API change shouldn't be a
> problem.
> 
> We also moved gnome_cups_get_printer_uri back into utils.c, where it
> makes more sense now I think.

Seems reasonable.  Please notify me when it goes in.  I'll patch
gnome-cups-manager and bump the version req.
(Continue reading)

Jody Goldberg | 13 Aug 2004 21:25
Picon

Re: [patch] fix error freeing case

On Fri, Jul 30, 2004 at 01:29:56PM -0400, Colin Walters wrote:
> Hi,
> 
> This little patch should avoid possibly double-freeing a GError.

> diff -u /src/work/rpms/libgnomecups/libgnomecups-0.1.9/libgnomecups/gnome-cups-request.c /tmp/buffer-content-19353QJP
> --- libgnomecups-0.1.9/libgnomecups/gnome-cups-request.c~	2004-07-29 13:53:18.862915872 -0400
> +++ libgnomecups-0.1.9/libgnomecups/gnome-cups-request.c	2004-07-29 13:53:29.574287496 -0400
>  <at>  <at>  -265,8 +266,6  <at>  <at> 
>  gnome_cups_request_struct_free (GnomeCupsRequest *request)
>  {
>  	g_free (request->path);
> -	if (request->error && *request->error)
> -		g_error_free (*request->error);
>  	g_free (request);
>  }	

This looks like the right thing, but The memory life cycle for these
requests is less than crystal clear.  Could you throw in some
comments on which parts of the request should be freed by the hander
and which we handle ?

Gmane