GNOME Bugzilla – Bug 668466
Add GnomePasswordSchemaAttribute
Last modified: 2019-02-22 11:45:52 UTC
GnomePasswordSchema currently uses an anonymous struct for the attributes member, which is a problem for Vala (and probably gobject introspection in general). Just adding a GnomePasswordSchemaAttribute type (you don't have to change the API to actually use it, just make it available) would be very helpful.
Created attachment 205845 [details] [review] Add GnomePasswordSchemaAttribute type
Review of attachment 205845 [details] [review]: Good plan. Just one comment: ::: library/gnome-keyring.h @@ -346,3 @@ GnomeKeyringItemType item_type; struct { const gchar* name; Why don't we use GnomeKeyringPasswordSchemaAttribute here in the GnomeKeyringPasswordSchema struct instead of specifying defining this struct twice?
(In reply to comment #2) > Review of attachment 205845 [details] [review]: > > Good plan. Just one comment: > > ::: library/gnome-keyring.h > @@ -346,3 @@ > GnomeKeyringItemType item_type; > struct { > const gchar* name; > > Why don't we use GnomeKeyringPasswordSchemaAttribute here in the > GnomeKeyringPasswordSchema struct instead of specifying defining this struct > twice? Because doing so would constitute an API break. Something like this would no longer work (you would get an error about assigning from struct <anonymous> to GnomeKeyringPasswordSchemaAttribute): GnomeKeyringPasswordSchema schema = { 0 }; struct { const gchar* name; GnomeKeyringAttributeType type; } attribute = { 0 }; schema.attributes[0] = attribute;
Good point. To make clear what's going on, how about we surround the new struct definition with a __GI_SCANNER__ or appropriate define? If that won't work, then let's put a clear comment explaining what the new struct is used for (vala and gir) and how it must match the anonymous struct in GnomeKeyringPasswordSchema.
Created attachment 205857 [details] [review] Add GnomePasswordSchemaAttribute type #ifdefing out the struct would work for runtime GI bindings, but it won't do Vala any good since we actually use the C headers.
Review of attachment 205857 [details] [review]: Looks good to me.
commit eea24c2445a953b96c7830c7927f2fa3d48b0272 Author: Evan Nemerson <evan@coeus-group.com> Date: Mon Jan 23 02:07:34 2012 -0800 Add GnomePasswordSchemaAttribute type https://bugzilla.gnome.org/show_bug.cgi?id=668466