GNOME Bugzilla – Bug 728491
[patch] Add get_type() functions for Gom*Error enums
Last modified: 2014-04-18 17:47:18 UTC
These are required for the introspection parser to pick up the enum members and to correctly annotate them as error domains. Of course, using glib-mkenums might be a better approach than doing this manually and keeping them in sync.
Created attachment 274660 [details] [review] gom: Add get_type() functions for Gom*Error enums These are required for the introspection parser to pick up the enum members, and to annotate them correctly as error domains.
Review of attachment 274660 [details] [review]: I'd rather all the error were moved to a single prefix first, so that we had only one error domain, and one place to define them all (call it gom/gom-error.h) Then we can do some mkenums Makefile hackery. ::: gom/gom-repository.c @@ +918,3 @@ + static gsize initialized = FALSE; + static const GEnumValue values[] = { + { GOM_REPOSITORY_ERROR_EMPTY_RESULT, "GOM_RESPOSITORY_ERROR_EMPTY_RESULT", "EMPTY_RESULT" }, Typo.
Created attachment 274661 [details] [review] gom: Add get_type() functions for Gom*Error enums These are required for the introspection parser to pick up the enum members, and to annotate them correctly as error domains.
(Same patch again but with typo fixed, I'll have a look at moving all the error domains to one place.)
Created attachment 274673 [details] [review] gom: Add get_type() functions for Gom*Error enums These are required for the introspection parser to pick up the enum members, and to annotate them correctly as error domains.
This is the same patch again?
I screwed up and attached the same patch (with the typo) the second time. The one in comment 5 should be correct, I think! (Still getting to grips with git-bz...)
(In reply to comment #7) > I screwed up and attached the same patch (with the typo) the second time. The > one in comment 5 should be correct, I think! (Still getting to grips with > git-bz...) Right, I was asking you to merge all the different type of errors under one single enum, so that we have GOM_ERROR, with GOM_ERROR_ADAPTER_OPEN, GOM_ERROR_COMMAND_NO_SQL, etc. and move it to gom-error.c and gom-error.h. I can do that later if you don't feel like updating your patch, but it'll have to wait a little bit...
Okay, done, patches coming up...
Created attachment 274694 [details] [review] Add GomError enum as a single unified error domain Adds GomError as a single error domain replacing GomCommandError, GomResourceError etc. The enumerators are taken from the existing four error domains used in Gom. This also adds a gom_error_get_type() function to define a GType for GomError, which is necessary for introspection purposes. It might be better to use glib-mkenums for this purpose.
Created attachment 274695 [details] [review] Use GomError rather than seperate errordomains Convert all functions to use the GomError domain for errors
Created attachment 274696 [details] [review] Remove separate error enums and quarks functions Replaced by GomError domain
All pushed, thanks for the patches!