GNOME Bugzilla – Bug 655189
object.c: Only care about properties in the .typelib
Last modified: 2018-01-27 11:48:35 UTC
This is quite ugly and should probably go in libgirepository.
Created attachment 192545 [details] [review] object.c: Only care about properties in the .typelib
Review of attachment 192545 [details] [review]: 1) Can we have some caching instead of iterating all properties and all classes every time a property is accessed? (not just a GObject property, any JS property get invokes the resolve hook) 2) Once we have a GPropertyInfo, can we use that (and annotations) instead of GType when marshalling the property value?
Review of attachment 192545 [details] [review]: What's the problem with current behaviour? Bug or the commit message offer no explanation. ::: gi/repo.c @@ +720,3 @@ g_string_append_c(s, g_ascii_tolower(*p)); + } else if (*p == '_') { + g_string_append_c(s, '-'); How is this related?
(In reply to comment #2) > Review of attachment 192545 [details] [review]: > > 1) Can we have some caching instead of iterating all properties and all classes > every time a property is accessed? (not just a GObject property, any JS > property get invokes the resolve hook) As I said, this is just a quick hack to get this working. This should probably go into libgirepository as g_object_info_find_property a la g_object_info_find_method > 2) Once we have a GPropertyInfo, can we use that (and annotations) instead of > GType when marshalling the property value? Sure, once find_property is properly written. (In reply to comment #3) > What's the problem with current behaviour? Bug or the commit message offer no > explanation. Yeah, sorry. The problem is libsoup, which has a somewhat weird API for convenience when using C libraries: see bug #655150 for some details. > ::: gi/repo.c > @@ +720,3 @@ > g_string_append_c(s, g_ascii_tolower(*p)); > + } else if (*p == '_') { > + g_string_append_c(s, '-'); > > How is this related? Otherwise the property name strcmp will fail, looking up "property_name", not "property-name".
(In reply to comment #4) > (In reply to comment #3) > > What's the problem with current behaviour? Bug or the commit message offer no > > explanation. > > Yeah, sorry. The problem is libsoup, which has a somewhat weird API for > convenience when using C libraries: see bug #655150 for some details. Which is to say, if a property is marked (skip), then we don't want to expose it as a property.
*** Bug 732142 has been marked as a duplicate of this bug. ***
Review of attachment 192545 [details] [review]: As per comments, this should go into gobject-introspection instead. Rejecting the patch to take it out of the review queue, but let's keep the bug open and fix this in g-i.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gjs/issues/61.