summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2015-07-26 23:59:36 -0700
committerJasper St. Pierre <jstpierre@mecheye.net>2015-07-27 17:21:05 -0700
commite1d4c8413bf3f2ed5e877ef472eca8a05f8152bd (patch)
tree5d2f7e70ba5920c8659aedf3e0252357fa02970b
parent09eabc053c5fdf169acf34ddc11403a00fd9851b (diff)
downloadgobject-introspection-e1d4c8413bf3f2ed5e877ef472eca8a05f8152bd.tar.gz
girepository: Remove "optimization" for found prefixes
This optimization is bugged and broken in the case of certain libraries. GNOME uses a lot of prefixes with "G", so we'll almost always have found the prefix. This is specifically a problem for something like GXml.xDocument, which uses a type name starting with a lower-case letter, which fools the prefix logic, but we're also fooled by the "G" appearing in GLib and Gio. A more sophisticated version of this check would have three passes: check prefix with type-case, check prefix without type-case, global search, but this is an edge case and it doesn't feel worth it to write.
-rw-r--r--girepository/girepository.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/girepository/girepository.c b/girepository/girepository.c
index 4291b7e3..4723c951 100644
--- a/girepository/girepository.c
+++ b/girepository/girepository.c
@@ -739,7 +739,6 @@ g_irepository_get_info (GIRepository *repository,
typedef struct {
const gchar *gtype_name;
GITypelib *result_typelib;
- gboolean found_prefix;
} FindByGTypeData;
static DirEntry *
@@ -757,8 +756,6 @@ find_by_gtype (GHashTable *table, FindByGTypeData *data, gboolean check_prefix)
{
if (!g_typelib_matches_gtype_name_prefix (typelib, data->gtype_name))
continue;
-
- data->found_prefix = TRUE;
}
ret = g_typelib_get_dir_entry_by_gtype_name (typelib, data->gtype_name);
@@ -805,7 +802,6 @@ g_irepository_find_by_gtype (GIRepository *repository,
data.gtype_name = g_type_name (gtype);
data.result_typelib = NULL;
- data.found_prefix = FALSE;
/* Inside each typelib, we include the "C prefix" which acts as
* a namespace mechanism. For GtkTreeView, the C prefix is Gtk.
@@ -818,13 +814,6 @@ g_irepository_find_by_gtype (GIRepository *repository,
if (entry == NULL)
entry = find_by_gtype (repository->priv->lazy_typelibs, &data, TRUE);
- /* If we have no result, but we did find a typelib claiming to
- * offer bindings for such a prefix, bail out now on the assumption
- * that a more exhaustive search would not produce any results.
- */
- if (entry == NULL && data.found_prefix)
- return NULL;
-
/* Not ever class library necessarily specifies a correct c_prefix,
* so take a second pass. This time we will try a global lookup,
* ignoring prefixes.