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 668466 - Add GnomePasswordSchemaAttribute
Add GnomePasswordSchemaAttribute
Status: RESOLVED FIXED
Product: libgnome-keyring
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-01-23 01:49 UTC by Evan Nemerson
Modified: 2019-02-22 11:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add GnomePasswordSchemaAttribute type (1.40 KB, patch)
2012-01-23 01:49 UTC, Evan Nemerson
needs-work Details | Review
Add GnomePasswordSchemaAttribute type (1.69 KB, patch)
2012-01-23 10:08 UTC, Evan Nemerson
accepted-commit_now Details | Review

Description Evan Nemerson 2012-01-23 01:49:04 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.
Comment 1 Evan Nemerson 2012-01-23 01:49:55 UTC
Created attachment 205845 [details] [review]
Add GnomePasswordSchemaAttribute type
Comment 2 Stef Walter 2012-01-23 06:27:51 UTC
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?
Comment 3 Evan Nemerson 2012-01-23 07:08:10 UTC
(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;
Comment 4 Stef Walter 2012-01-23 08:05:58 UTC
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.
Comment 5 Evan Nemerson 2012-01-23 10:08:46 UTC
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.
Comment 6 Stef Walter 2012-02-04 10:07:19 UTC
Review of attachment 205857 [details] [review]:

Looks good to me.
Comment 7 Stef Walter 2012-02-04 10:07:20 UTC
Review of attachment 205857 [details] [review]:

Looks good to me.
Comment 8 Evan Nemerson 2012-02-05 01:15:25 UTC
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