Add back unresolved

svn path=/trunk/; revision=545
This commit is contained in:
Colin Walters 2008-08-30 20:31:16 +00:00
parent 5a14ec555c
commit dcd4fe622a
2 changed files with 26 additions and 7 deletions

30
ginfo.c
View File

@ -174,12 +174,17 @@ g_info_from_entry (GTypelib *typelib,
result = g_irepository_find_by_name (repository, namespace, name);
if (result == NULL)
{
char **all_namespaces = g_irepository_get_namespaces (repository);
char *namespaces_str = g_strjoinv (", ", all_namespaces);
g_critical ("Failed to find namespace: %s name: %s (currently loaded namespaces: %s)", namespace,
name, namespaces_str);
g_strfreev (all_namespaces);
g_free (namespaces_str);
GIUnresolvedInfo *unresolved;
unresolved = g_new0 (GIUnresolvedInfo, 1);
unresolved->type = GI_INFO_TYPE_UNRESOLVED;
unresolved->ref_count = 1;
unresolved->container = NULL;
unresolved->name = name;
unresolved->namespace = namespace;
return (GIBaseInfo*)unresolved;
}
return result;
}
@ -289,7 +294,13 @@ g_base_info_get_name (GIBaseInfo *info)
return g_typelib_get_string (info->typelib, blob->name);
}
break;
case GI_INFO_TYPE_UNRESOLVED:
{
GIUnresolvedInfo *unresolved = (GIUnresolvedInfo *)info;
return unresolved->name;
}
break;
case GI_INFO_TYPE_TYPE:
default: ;
g_assert_not_reached ();
@ -306,6 +317,13 @@ g_base_info_get_namespace (GIBaseInfo *info)
g_assert (info->ref_count > 0);
if (info->type == GI_INFO_TYPE_UNRESOLVED)
{
GIUnresolvedInfo *unresolved = (GIUnresolvedInfo *)info;
return unresolved->namespace;
}
return g_typelib_get_string (info->typelib, header->namespace);
}

View File

@ -150,7 +150,8 @@ typedef enum
GI_INFO_TYPE_PROPERTY,
GI_INFO_TYPE_FIELD,
GI_INFO_TYPE_ARG,
GI_INFO_TYPE_TYPE
GI_INFO_TYPE_TYPE,
GI_INFO_TYPE_UNRESOLVED
} GIInfoType;