Version of dee_model_build_named_row
for language bindings - as opposed to dee_model_build_named_row
, the
returned variants will be strong references, therefore you always have to call g_variant_unref
on the items and
g_free the array itself if null
was passed as out_row_members
.
If out_row_members
is non-%NULL, g_variant_unref
will be called on its elements (if also non-%NULL), which
allows easy reuse of the array memory in loops.
This is utility function and will not touch or modify this in any way.
Example of memory management for model with schema ("s", "i") and column names ("uri", "count"):
GVariant **row_buf;
row_buf = dee_model_build_named_row_sunk (model, NULL, "uri", "file:///",
"count", 0, NULL);
dee_model_append_row (model, row_buf);
for (int i = 1; i < 100; i++)
{
dee_model_append_row (model,
dee_model_build_named_row_sunk (model, row_buf, "uri", "file:///",
"count", i, NULL));
}
g_variant_unref (row_buf[0]);
g_variant_unref (row_buf[1]);
g_free (row_buf);
this |
The model to create a row for |
out_row_members |
An array to write the values to or |
first_column_name |
A column name |
out_array_length |
Length of the returned variant array |
If |