girepository: Add g_irepository_get_immediate_dependencies()

g_irepository_get_dependencies() is supposed to return the transitive
closure of all dependencies of the given namespace. However, it just
loads the dependencies field from the typelib, which is supposed to only
list immediate dependencies.

Introduce a new g_irepository_get_immediate_dependencies() which does
this, and rewrite g_irepository_get_dependencies() to build the
transitive closure of all its namespace dependencies. This does not
require loading any new typelibs, as the transitive closure of
dependencies should already have been loaded by g_irepository_require()
or g_irepository_load_typelib().

https://bugzilla.gnome.org/show_bug.cgi?id=743782
This commit is contained in:
Philip Withnall
2015-01-31 22:48:56 +00:00
committed by Philip Withnall
parent 5389e87a29
commit e222ca2ef2
4 changed files with 132 additions and 11 deletions

View File

@@ -143,6 +143,10 @@ GITypelib * g_irepository_require_private (GIRepository *repository,
GIRepositoryLoadFlags flags,
GError **error);
GI_AVAILABLE_IN_1_44
gchar ** g_irepository_get_immediate_dependencies (GIRepository *repository,
const gchar *namespace_);
GI_AVAILABLE_IN_ALL
gchar ** g_irepository_get_dependencies (GIRepository *repository,
const gchar *namespace_);