GNOME Bugzilla – Bug 629326
Re-registering a model shouldn't emit warning
Last modified: 2010-12-20 21:14:20 UTC
Created attachment 169996 [details] [review] babl-model.c: allow reregistering model w/o warning When re-registering a color model (which should be expected from extensions) babl emits a warning which in turn messes up the introspection DHTML. The attached patch adds a check if the new model is different from the old (which would be bad) and only then emits the warning. (So far the other functions (babl_format_new() etc.) just silently return the existing object if the names match.)
Created attachment 170238 [details] [review] Handle reregister of models/formats/types Extended the duplicate check to formats and types. Made conflicting registrations fatal. Also fixed conflicting registrations for "Y'CbCr u8" which showed up through the new tests. One thing I wasn't quite sure about: In model-ycbcr.c, the "Y'CbCr u8" format was registered with id BABL_YCBCR420. I removed the id, as it seems to be an error, but you might want to double-check that.
Created attachment 170596 [details] [review] Updated patch to catch conflicting id Updated patch to catch duplicate registrations with different ids. (See Bug 630061)
Created attachment 171480 [details] [review] Extended patch to babl_component_new() Included duplicate checks for babl_component_new(). Note that bug 630061 needs to be fixed in order to run this successfully. Otherwise the new checks will throw an error on the attempted duplicate-but-different registration of "RGBA double".
commit 740baf02ac245496acc5807d723f06e50e30e853 Author: Rupert Weber <gimp@leguanease.org> Date: Fri Oct 1 02:18:53 2010 +0200 allow reregistering but check for differences babl_model_new() emitted a warning when reregistering a model, babl_format_new(), babl_type_new(), and babl_component_new() quietly returned a preexisting object. Changed so that all four functions return the preexisting object if the new registration doesn't conflict, otherwise make the error fatal. (Fixed some conflicting and redundant registrations for "Y'CbCr u8" along the way)