After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 120651 - gnome_print_job_new() does not just call g_object_new()
gnome_print_job_new() does not just call g_object_new()
Status: RESOLVED FIXED
Product: gnome-print
Classification: Deprecated
Component: general
CVS
Other Linux
: Normal normal
: ---
Assigned To: Chema Celorio
Chema Celorio
Depends on:
Blocks:
 
 
Reported: 2003-08-25 10:05 UTC by Murray Cumming
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
job_construct.patch (1.89 KB, patch)
2003-08-25 10:05 UTC, Murray Cumming
none Details | Review
job_constuct2.patch (2.51 KB, patch)
2003-09-29 10:42 UTC, Murray Cumming
none Details | Review
job_properties.patch (4.81 KB, patch)
2003-10-14 15:49 UTC, Murray Cumming
none Details | Review

Description Murray Cumming 2003-08-25 10:05:08 UTC
_new functions should just call g_object_new() with appropriate property
values, but gnome_print_job() new does more, making life difficult for
language bindings.

Here is a non-API/ABI breaking patch to fix this, by adding a _construct()
method, but this should really be a property instead.
Comment 1 Murray Cumming 2003-08-25 10:05:58 UTC
Created attachment 19481 [details] [review]
job_construct.patch
Comment 2 Chema Celorio 2003-09-19 14:09:03 UTC
Please provide patches with "-u 5", otherwise it is extremelly hard to
read.
Comment 3 Murray Cumming 2003-09-19 14:12:32 UTC
Oh, sorry. Can you manage with this one for now though? I have a 
lousy connection so I won't be able to redo it for a while.
Comment 4 Murray Cumming 2003-09-23 15:23:39 UTC
Pretty please?
Comment 5 Murray Cumming 2003-09-29 10:42:59 UTC
Created attachment 20346 [details] [review]
job_constuct2.patch
Comment 6 Murray Cumming 2003-09-29 10:43:47 UTC
Here (job_construct2.patch) is regular -up version of the patch.
Comment 7 Jody Goldberg 2003-10-06 23:15:50 UTC
I agree its a problem, but not with the proposed solution.  Lets make it a property
and init to the default.
Comment 8 Murray Cumming 2003-10-14 15:49:37 UTC
Created attachment 20699 [details] [review]
job_properties.patch
Comment 9 Murray Cumming 2003-10-14 15:50:02 UTC
job_properties.patch, as suggested.
Comment 10 Murray Cumming 2003-11-06 10:35:09 UTC
May I apply this?
Comment 11 Andreas J. Guelzow 2003-11-14 03:52:04 UTC
I am committing this patch to cvs HEAD. I'll test it on gnome-2-4
tomorrow afternoon and submit it then to if appropriate.
Comment 12 Andreas J. Guelzow 2003-11-17 05:58:40 UTC
gnome_print_job_get_property in this patch is nonsense. Unfortunately
I didn't realize that until after I committed it and chased some
strange bug through gnumeric and libgnomeprint. (I guess we imagine
that we see what we like to see, rather than what the code is really
doing.)

Comment 13 Andreas J. Guelzow 2003-11-17 06:09:05 UTC
committed the fixed patch to gnome-2-4
Comment 14 Murray Cumming 2003-11-18 09:04:35 UTC
I don't know what the problem was with gnome_print_job_get_property()
and I don't see any fix in cvs. Please explain in future.

But, in your change to gnome_print_job_set_property() here, if you are
going to ref the config, then I think you need to ref it when using
the default too. Otherwise I think you will unref something that you
have not reffed:
http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvs/gnome&subdir=libgnomeprint%2Flibgnomeprint&command=DIFF_FRAMESET&root=/cvs/gnome&file=gnome-print-job.c&rev1=1.61&rev2=1.62

Or I could be competely wrong - feel free to close this again.
Comment 15 Murray Cumming 2003-11-18 09:06:10 UTC
Oh, I see my previous unref problem now, and I see that the new
problem is from me too, but I still think it could be a problem.
Comment 16 Andreas J. Guelzow 2003-11-19 21:06:25 UTC
Hi Murray,

sorry about the confusion:

The problem was with your gnome_print_job_set_property. If you look at
your patch you will see that at the time of the if(config) the config
had to be 0, so we never really installed the config but always used
the  default.

Regarding the ref in the fixed gnome_print_job_set_property, in the
default case we are swallowing the ref from gnome_print_config_default
(since gnome_print_config_default does not have a chanve to release
it.) but we don't swallow it for config since it is likely that the
caller still needs it. IT is the callers responsibility to release the
ref if it does not need the ref anymore. in many (most?) cases the
caller will want to hold on to the config.)