mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-25 03:32:12 +01:00
Fix regression in g_irepository_get_info
Commit f97cc8687469f25752f79275 broke the lookup in g_irepository_get_info; the passed offset is 0-based, then we convert it to 1-based (and then back to 0 later...which needs to be fixed).
This commit is contained in:
parent
54a1a7be49
commit
3d7bb7feaf
@ -519,11 +519,13 @@ g_irepository_get_n_infos (GIRepository *repository,
|
|||||||
* g_irepository_get_info:
|
* g_irepository_get_info:
|
||||||
* @repository: (allow-none): A #GIRepository, may be %NULL for the default
|
* @repository: (allow-none): A #GIRepository, may be %NULL for the default
|
||||||
* @namespace_: Namespace to inspect
|
* @namespace_: Namespace to inspect
|
||||||
* @index: Offset into namespace metadata for entry
|
* @index: 0-based offset into namespace metadata for entry
|
||||||
*
|
*
|
||||||
* This function returns a particular metadata entry in the
|
* This function returns a particular metadata entry in the
|
||||||
* given namespace @namespace_. The namespace must have
|
* given namespace @namespace_. The namespace must have
|
||||||
* already been loaded before calling this function.
|
* already been loaded before calling this function.
|
||||||
|
* See g_irepository_get_n_infos() to find the maximum number of
|
||||||
|
* entries.
|
||||||
*
|
*
|
||||||
* Returns: (transfer full): #GIBaseInfo containing metadata
|
* Returns: (transfer full): #GIBaseInfo containing metadata
|
||||||
*/
|
*/
|
||||||
@ -543,7 +545,7 @@ g_irepository_get_info (GIRepository *repository,
|
|||||||
|
|
||||||
g_return_val_if_fail (typelib != NULL, NULL);
|
g_return_val_if_fail (typelib != NULL, NULL);
|
||||||
|
|
||||||
entry = g_typelib_get_dir_entry (typelib, index);
|
entry = g_typelib_get_dir_entry (typelib, index + 1);
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
return _g_info_new_full (entry->blob_type,
|
return _g_info_new_full (entry->blob_type,
|
||||||
|
@ -1349,6 +1349,7 @@ gir_writer_write (const char *filename,
|
|||||||
const gchar *c_prefix;
|
const gchar *c_prefix;
|
||||||
const char *ns = namespace;
|
const char *ns = namespace;
|
||||||
const char *version;
|
const char *version;
|
||||||
|
gint n_infos;
|
||||||
|
|
||||||
version = g_irepository_get_version (repository, ns);
|
version = g_irepository_get_version (repository, ns);
|
||||||
|
|
||||||
@ -1361,7 +1362,8 @@ gir_writer_write (const char *filename,
|
|||||||
if (c_prefix)
|
if (c_prefix)
|
||||||
xml_printf (xml, " c:prefix=\"%s\"", c_prefix);
|
xml_printf (xml, " c:prefix=\"%s\"", c_prefix);
|
||||||
|
|
||||||
for (j = 0; j < g_irepository_get_n_infos (repository, ns); j++)
|
n_infos = g_irepository_get_n_infos (repository, ns);
|
||||||
|
for (j = 0; j < n_infos; j++)
|
||||||
{
|
{
|
||||||
GIBaseInfo *info = g_irepository_get_info (repository, ns, j);
|
GIBaseInfo *info = g_irepository_get_info (repository, ns, j);
|
||||||
switch (g_base_info_get_type (info))
|
switch (g_base_info_get_type (info))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user