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 655189 - object.c: Only care about properties in the .typelib
object.c: Only care about properties in the .typelib
Status: RESOLVED OBSOLETE
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
: 732142 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-07-23 22:19 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2018-01-27 11:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
object.c: Only care about properties in the .typelib (2.22 KB, patch)
2011-07-23 22:19 UTC, Jasper St. Pierre (not reading bugmail)
rejected Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-07-23 22:19:12 UTC
This is quite ugly and should probably go in libgirepository.
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-07-23 22:19:14 UTC
Created attachment 192545 [details] [review]
object.c: Only care about properties in the .typelib
Comment 2 Giovanni Campagna 2011-07-24 10:45:29 UTC
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?
Comment 3 Tommi Komulainen 2011-07-24 10:56:27 UTC
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?
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-07-24 15:19:56 UTC
(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".
Comment 5 Dan Winship 2011-07-24 15:29:03 UTC
(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.
Comment 6 Dan Winship 2014-06-24 14:10:18 UTC
*** Bug 732142 has been marked as a duplicate of this bug. ***
Comment 7 Philip Chimento 2017-04-02 23:37:24 UTC
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.
Comment 8 GNOME Infrastructure Team 2018-01-27 11:48:35 UTC
-- 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.