- type = u_object_module_get_class(package, class);
- if (!type) {
- printf(" (unknown class)\n");
- return 0;
- }
-
- obj = g_object_new(type, NULL);
-
- if (u_object_deserialize(obj, upkg, idx) != 0) {
- g_object_unref(obj);
+ obj = u_object_new_from_package(upkg, idx);
+ if (!obj) {
+ fprintf(stderr, "%s: failed to load object.\n",
+ progname);