gobject-introspection r889 - in trunk: . girepository
- From: otaylor svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r889 - in trunk: . girepository
- Date: Tue, 11 Nov 2008 22:02:38 +0000 (UTC)
Author: otaylor
Date: Tue Nov 11 22:02:37 2008
New Revision: 889
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=889&view=rev
Log:
Bug 560404 â Prefix types when resolving aliases in included modules
* girepository/girparser.c: When resolving aliases in an included
module, prefix types before looking them up.
Modified:
trunk/ChangeLog
trunk/girepository/girparser.c
Modified: trunk/girepository/girparser.c
==============================================================================
--- trunk/girepository/girparser.c (original)
+++ trunk/girepository/girparser.c Tue Nov 11 22:02:37 2008
@@ -478,19 +478,39 @@
gpointer orig;
gpointer value;
GSList *seen_values = NULL;
+ const char *lookup;
+ char *prefixed;
- seen_values = g_slist_prepend (seen_values, (char*)type);
- while (g_hash_table_lookup_extended (ctx->aliases, type, &orig, &value))
+ /* If we are in an included module, then we need to qualify the
+ * names of types before resolving them, since they will have
+ * been stored in the aliases qualified.
+ */
+ if (ctx->prefix_aliases && strchr (type, '.') == NULL)
+ {
+ prefixed = g_strdup_printf ("%s.%s", ctx->namespace, type);
+ lookup = prefixed;
+ }
+ else
+ lookup = type;
+
+ seen_values = g_slist_prepend (seen_values, (char*)lookup);
+ while (g_hash_table_lookup_extended (ctx->aliases, lookup, &orig, &value))
{
- g_debug ("Resolved: %s => %s", type, (char*)value);
- type = value;
- if (g_slist_find_custom (seen_values, type,
+ g_debug ("Resolved: %s => %s\n", lookup, (char*)value);
+ lookup = value;
+ if (g_slist_find_custom (seen_values, lookup,
(GCompareFunc)strcmp) != NULL)
break;
- seen_values = g_slist_prepend (seen_values, (gchar*)type);
+ seen_values = g_slist_prepend (seen_values, (gchar*)lookup);
}
g_slist_free (seen_values);
- return type;
+
+ if (lookup == prefixed)
+ lookup = type;
+
+ g_free (prefixed);
+
+ return lookup;
}
static GIrNodeType *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]