From e8b336cc0747b528263ec809d142f4803dcbdf35 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 21 Sep 2011 13:13:45 -0400 Subject: [PATCH 1/8] repository: Fix g_irepository_get_c_prefix() It was returning the wrong data. https://bugzilla.gnome.org/show_bug.cgi?id=659749 --- girepository/girepository.c | 2 +- tests/repository/gitestrepo.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/girepository/girepository.c b/girepository/girepository.c index cc81107..b5cd4c7 100644 --- a/girepository/girepository.c +++ b/girepository/girepository.c @@ -929,7 +929,7 @@ g_irepository_get_c_prefix (GIRepository *repository, g_return_val_if_fail (typelib != NULL, NULL); header = (Header *) typelib->data; - if (header->shared_library) + if (header->c_prefix) return g_typelib_get_string (typelib, header->c_prefix); else return NULL; diff --git a/tests/repository/gitestrepo.c b/tests/repository/gitestrepo.c index cdaeb4c..05ea5d9 100644 --- a/tests/repository/gitestrepo.c +++ b/tests/repository/gitestrepo.c @@ -46,6 +46,7 @@ main(int argc, char **argv) GIBaseInfo *siginfo; GIEnumInfo *errorinfo; GType gtype; + const char *prefix; g_type_init (); @@ -55,6 +56,10 @@ main(int argc, char **argv) if (!ret) g_error ("%s", error->message); + prefix = g_irepository_get_c_prefix (repo, "Gio"); + g_assert (prefix != NULL); + g_assert_cmpstr (prefix, ==, "G"); + info = g_irepository_find_by_name (repo, "Gio", "Cancellable"); g_assert (info != NULL); g_assert (g_base_info_get_type (info) == GI_INFO_TYPE_OBJECT); -- 1.7.7