[glib] Revert "GVariant: add g_variant_default_value()"



commit f2ae6217771b1014efb86eab0f5346d3b297024e
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jun 17 14:58:46 2010 -0400

    Revert "GVariant: add g_variant_default_value()"
    
    This reverts commit b205dc77cb14f67818eaac23d0eb3f5d1b867921.
    
    We decided to go the other route with the GParamSpec.

 docs/reference/glib/glib-sections.txt |    1 -
 glib/glib.symbols                     |    1 -
 glib/gvariant.c                       |   32 ++------------------------------
 glib/gvariant.h                       |    1 -
 4 files changed, 2 insertions(+), 33 deletions(-)
---
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt
index d4a5ece..ec4892d 100644
--- a/docs/reference/glib/glib-sections.txt
+++ b/docs/reference/glib/glib-sections.txt
@@ -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
diff --git a/glib/glib.symbols b/glib/glib.symbols
index ffc4d8e..cb1318f 100644
--- a/glib/glib.symbols
+++ b/glib/glib.symbols
@@ -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
diff --git a/glib/gvariant.c b/glib/gvariant.c
index 4ffa7e5..3b5fd8c 100644
--- a/glib/gvariant.c
+++ b/glib/gvariant.c
@@ -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:
diff --git a/glib/gvariant.h b/glib/gvariant.h
index 87bf588..e4a80c0 100644
--- a/glib/gvariant.h
+++ b/glib/gvariant.h
@@ -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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]