Commit 19a1f1e4 authored by Zander's avatar Zander 💥

Improved docs, NULL strv when emptied

parent 295ac5f6
......@@ -67,6 +67,10 @@ strv_move_next (TmplIterator *iter)
{
gchar **strv = iter->instance;
iter->data1 = GINT_TO_POINTER (index);
if (!strv[index])
{
iter->instance = NULL;
}
return strv[index] != 0;
}
......@@ -174,10 +178,8 @@ tmpl_iterator_init (TmplIterator *iter,
iter->destroy = NULL;
iter->data1 = GINT_TO_POINTER (-1);
}
else if (G_VALUE_HOLDS_BOXED(value))
else if (G_VALUE_HOLDS (value, G_TYPE_STRV))
{
// TODO: On the basis more than just strv can be boxed there
// should be more checks here
iter->instance = (const gchar **) g_value_get_boxed (value);
iter->move_next = strv_move_next;
iter->get_value = strv_get_value;
......
......@@ -307,6 +307,8 @@ tmpl_scope_set_object (TmplScope *self,
* @value: (nullable): the variant to set it to, or %NULL
*
* Sets the value of the symbol named @name to the variant @value.
*
* If @value has a floating reference, it is consumed.
*/
void
tmpl_scope_set_variant (TmplScope *self,
......
......@@ -243,6 +243,15 @@ tmpl_symbol_assign_object (TmplSymbol *self,
g_value_unset (&value);
}
/**
* tmpl_symbol_assign_variant:
* @self: A #TmplSymbol
* @v_object: (nullable): a #GVariant or %NULL.
*
* Sets the value to the #GVariant @v_variant.
*
* If @v_variant has a floating reference, it is consumed.
*/
void
tmpl_symbol_assign_variant (TmplSymbol *self,
GVariant *v_variant)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment