Revert "GVariant: add g_variant_default_value()"

This reverts commit b205dc77cb.

We decided to go the other route with the GParamSpec.
This commit is contained in:
Ryan Lortie 2010-06-17 14:58:46 -04:00
parent 58e000d301
commit f2ae621777
4 changed files with 2 additions and 33 deletions

View File

@ -2813,7 +2813,6 @@ g_variant_get_type_string
g_variant_is_of_type
g_variant_is_container
g_variant_compare
g_variant_default_value
<SUBSECTION>
g_variant_classify

View File

@ -1725,7 +1725,6 @@ g_variant_is_of_type
g_variant_is_container
g_variant_classify
g_variant_compare
g_variant_default_value
g_variant_new_boolean
g_variant_new_byte

View File

@ -1377,7 +1377,7 @@ g_variant_dup_strv (GVariant *value,
return strv;
}
/* Type checking, querying, default value {{{1 */
/* Type checking and querying {{{1 */
/**
* g_variant_get_type:
* @value: a #GVariant
@ -1455,6 +1455,7 @@ g_variant_is_container (GVariant *value)
return g_variant_type_is_container (g_variant_get_type (value));
}
/**
* g_variant_classify:
* @value: a #GVariant
@ -1499,35 +1500,6 @@ g_variant_classify (GVariant *value)
return *g_variant_get_type_string (value);
}
/**
* g_variant_default_value:
* @type: a definite #GVariantType
* @returns: a reference to a #GVariant of the requested type
*
* Returns the "default value" for @type. The default boolean instance
* is false, the default value for any numeric type is (positive) zero,
* the default array is empty and the default maybe instance is Nothing.
* The default value for a tuple type is the tuple containing the
* default value for each child. This is roughly equivalent to the
* values produced by the serialiser when it detects invalid data.
*
* Since: 2.26
**/
GVariant *
g_variant_default_value (const GVariantType *type)
{
GVariant *broken, *fixed;
g_return_val_if_fail (g_variant_type_is_definite (type), NULL);
/* let the serialiser figure it out */
broken = g_variant_new_from_data (type, NULL, 0, FALSE, NULL, NULL);
fixed = g_variant_get_normal_form (broken);
g_variant_unref (broken);
return fixed;
}
/* Pretty printer {{{1 */
/**
* g_variant_print_string:

View File

@ -62,7 +62,6 @@ gboolean g_variant_is_of_type (GVarian
const GVariantType *type);
gboolean g_variant_is_container (GVariant *value);
GVariantClass g_variant_classify (GVariant *value);
GVariant * g_variant_default_value (const GVariantType *type);
GVariant * g_variant_new_boolean (gboolean boolean);
GVariant * g_variant_new_byte (guchar byte);
GVariant * g_variant_new_int16 (gint16 int16);