Annotate GVariant and GSettings _strv() functions

Add GObject introspection annotations so that the length parameter is
correctly detected for g_variant_new_strv(), g_variant_get_strv() and
g_variant_dup_strv(). Also specify that it can be a NULL pointer in
g_variant_get_strv() and g_variant_dup_strv().

For g_settings_set_strv(), detect that a NULL value is allowed, meaning
empty array.

Closes bug #620384.

Signed-off-by: Ryan Lortie <desrt@desrt.ca>
This commit is contained in:
Milan Bouchet-Valat 2010-06-02 16:05:13 +02:00 committed by Ryan Lortie
parent 0e691f27ec
commit 3682666140
2 changed files with 6 additions and 6 deletions

View File

@ -1833,7 +1833,7 @@ g_settings_get_strv (GSettings *settings,
* g_settings_set_strv:
* @settings: a #GSettings object
* @key: the name of the key to set
* @value: the value to set it to, or %NULL
* @value: (allow-none): the value to set it to, or %NULL
* @returns: %TRUE if setting the key succeeded,
* %FALSE if the key was not writable
*

View File

@ -1244,7 +1244,7 @@ g_variant_get_byte_array (GVariant *value,
* g_variant_new_strv:
* @strv: an array of strings
* @length: the length of @strv, or -1
* @returns: a new floating #GVariant instance
* @returns: (array length=length): a new floating #GVariant instance
*
* Constructs an array of strings #GVariant from the given array of
* strings.
@ -1277,8 +1277,8 @@ g_variant_new_strv (const gchar * const *strv,
/**
* g_variant_get_strv:
* @value: an array of strings #GVariant
* @length: the length of the result, or %NULL
* @returns: an array of constant strings
* @length: (allow-none): the length of the result, or %NULL
* @returns: (array length=length): an array of constant strings
*
* Gets the contents of an array of strings #GVariant. This call
* makes a shallow copy; the return result should be released with
@ -1329,8 +1329,8 @@ g_variant_get_strv (GVariant *value,
/**
* g_variant_dup_strv:
* @value: an array of strings #GVariant
* @length: the length of the result, or %NULL
* @returns: an array of constant strings
* @length: (allow-none): the length of the result, or %NULL
* @returns: (array length=length): an array of constant strings
*
* Gets the contents of an array of strings #GVariant. This call
* makes a deep copy; the return result should be released with