summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2018-08-07 13:20:11 +0200
committerFlorian Müllner <fmuellner@gnome.org>2018-08-10 20:39:10 +0200
commit97da6c39f9802fbf8880fb3520f0fe059fb676b1 (patch)
treefc888bf2fa013e95793f625bb5bffb8ad2978696
parent1681591e9158248f6894292c66c8b49b0034e12e (diff)
downloadgjs-97da6c39f9802fbf8880fb3520f0fe059fb676b1.tar.gz
object: Resolve interface properties on native objects as well
Since commit 12ace06a6, we lazily resolve interface properties of non-introspected GObjects. However we also lazily resolve properties on introspected GObjects we didn't create ourselves - we need to take interface properties into account there as well. https://gitlab.gnome.org/GNOME/gjs/merge_requests/223
-rw-r--r--gi/object.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/gi/object.cpp b/gi/object.cpp
index 70032736..0082ecbf 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -789,6 +789,7 @@ is_gobject_property_name(GIObjectInfo *info,
const char *name)
{
int n_props = g_object_info_get_n_properties(info);
+ int n_ifaces = g_object_info_get_n_interfaces(info);
int ix;
GjsAutoInfo<GIPropertyInfo> prop_info;
@@ -802,6 +803,17 @@ is_gobject_property_name(GIObjectInfo *info,
prop_info.reset();
}
+ if (!prop_info) {
+ for (ix = 0; ix < n_ifaces; ix++) {
+ GjsAutoInfo<GIInterfaceInfo> iface_info =
+ g_object_info_get_interface(info, ix);
+ if (is_ginterface_property_name(iface_info, canonical_name)) {
+ g_free(canonical_name);
+ return true;
+ }
+ }
+ }
+
g_free(canonical_name);
if (!prop_info)