]> git.draconx.ca Git - upkg.git/commitdiff
upkg: Display object names in property listings.
authorNick Bowler <nbowler@draconx.ca>
Sat, 12 May 2012 02:09:40 +0000 (22:09 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sat, 12 May 2012 02:09:40 +0000 (22:09 -0400)
Not particularly useful right now since we can only display the last
component of the name, but it's a start.

src/upkg.c

index dbaa3fd2a91c1589ee7c818831d9441cdd4fc26c..8fe9a2afd2789c98c5e32d1d84903e87d5fd0a64 100644 (file)
@@ -296,13 +296,24 @@ static int object_info(GTypeModule *pkg, unsigned long idx)
                        GValue val = {0};
                        char *valstr;
 
-                       printf("  property %s: ", props[i]->name);
+                       printf("  property %s:", props[i]->name);
                        fflush(stdout);
 
                        g_value_init(&val, props[i]->value_type);
                        g_object_get_property(obj, props[i]->name, &val);
+
+                       if (G_VALUE_HOLDS(&val, U_TYPE_OBJECT)) {
+                               UObject *obj = g_value_get_object(&val);
+
+                               /* TODO: Display full object names here. */
+                               if (obj->pkg_file) {
+                                       printf(" %s", obj->pkg_file->name);
+                               }
+                       }
+
                        valstr = g_strdup_value_contents(&val);
-                       printf("%s\n", valstr);
+                       printf(" %s\n", valstr);
+                       g_free(valstr);
                }
                free(props);