[glibmm] VariantType: Capitalize the standard types.



commit 04794eb52d03c5520127045f391d0b01faf8b767
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Mar 28 15:20:52 2011 +0200

    VariantType: Capitalize the standard types.
    
    	* glib/src/varianttype.[hg|ccg]: Use, for instance VARIANT_TYPE_STRING instead
    	of VariantTypeString. This seems more appropriate for a constant and is the
    	style used by gtkmm's STOCK_* items, which this is based on.
    	* glib/src/variant.ccg: Adapt.

 glib/src/variant.ccg     |   17 ++++++-----------
 glib/src/varianttype.ccg |    4 ++--
 glib/src/varianttype.hg  |    4 ++--
 3 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg
index b4a100c..a627531 100644
--- a/glib/src/variant.ccg
+++ b/glib/src/variant.ccg
@@ -138,8 +138,7 @@ void VariantBase::init(const GVariant* cobject, bool take_a_reference)
 // static
 const VariantType& Variant<VariantBase>::variant_type()
 {
-  static VariantType type(G_VARIANT_TYPE_VARIANT);
-  return type;
+  return VARIANT_TYPE_VARIANT;
 }
 
 Variant<VariantBase> Variant<VariantBase>::create(const VariantBase& data)
@@ -161,8 +160,7 @@ void Variant<VariantBase>::get(VariantBase& variant) const
 // static
 const VariantType& Variant<Glib::ustring>::variant_type()
 {
-  static VariantType type(G_VARIANT_TYPE_STRING);
-  return type;
+  return VARIANT_TYPE_STRING;
 }
 
 Variant<Glib::ustring>
@@ -209,8 +207,7 @@ throw(std::bad_cast)
 // static
 const VariantType& Variant<std::string>::variant_type()
 {
-  static VariantType type(G_VARIANT_TYPE_BYTESTRING);
-  return type;
+  return VARIANT_TYPE_BYTESTRING;
 }
 
 Variant<std::string>
@@ -238,7 +235,7 @@ throw(std::bad_cast)
 
   const VariantType vtype = v.get_type();
   if( vtype.equal(VARIANT_TYPE_STRING) ||
-      vtype.equal(VARIANT_TYPE_BYTE_STRING) ||  
+      vtype.equal(VARIANT_TYPE_BYTESTRING) ||  
       vtype.equal(VARIANT_TYPE_OBJECT_PATH) ||
       vtype.equal(VARIANT_TYPE_SIGNATURE) )
   {
@@ -255,8 +252,7 @@ typedef std::vector<Glib::ustring> type_vec_ustring;
 // static
 const VariantType& Variant<type_vec_ustring>::variant_type()
 {
-  static VariantType type(G_VARIANT_TYPE_STRING_ARRAY);
-  return type;
+  return VARIANT_TYPE_STRING_ARRAY;
 }
 
 Variant<type_vec_ustring>
@@ -339,8 +335,7 @@ typedef std::vector<std::string> type_vec_string;
 // static
 const VariantType& Variant<type_vec_string>::variant_type()
 {
-  static VariantType type(G_VARIANT_TYPE_BYTESTRING_ARRAY);
-  return type;
+  return VARIANT_TYPE_BYTESTRING_ARRAY;
 }
 
 Variant<type_vec_string>
diff --git a/glib/src/varianttype.ccg b/glib/src/varianttype.ccg
index 5abf71e..6b64530 100644
--- a/glib/src/varianttype.ccg
+++ b/glib/src/varianttype.ccg
@@ -97,8 +97,8 @@ const VariantType VARIANT_TYPE_DICTIONARY(G_VARIANT_TYPE_DICTIONARY);
 
 const VariantType VARIANT_TYPE_STRING_ARRAY(G_VARIANT_TYPE_STRING_ARRAY);
 
-const VariantType VARIANT_TYPE_BYTE_STRING(G_VARIANT_TYPE_BYTESTRING);
+const VariantType VARIANT_TYPE_BYTESTRING(G_VARIANT_TYPE_BYTESTRING);
 
-const VariantType VARIANT_TYPE_BYTE_STRING_ARRAY(G_VARIANT_TYPE_STRING_ARRAY);
+const VariantType VARIANT_TYPE_BYTESTRING_ARRAY(G_VARIANT_TYPE_STRING_ARRAY);
 
 }
diff --git a/glib/src/varianttype.hg b/glib/src/varianttype.hg
index a954c27..feb2fb9 100644
--- a/glib/src/varianttype.hg
+++ b/glib/src/varianttype.hg
@@ -192,9 +192,9 @@ extern const VariantType VARIANT_TYPE_DICTIONARY;
 
 extern const VariantType VARIANT_TYPE_STRING_ARRAY;
 
-extern const VariantType VARIANT_TYPE_BYTE_STRING;
+extern const VariantType VARIANT_TYPE_BYTESTRING;
 
-extern const VariantType VARIANT_TYPE_BYTE_STRING_ARRAY;
+extern const VariantType VARIANT_TYPE_BYTESTRING_ARRAY;
 
 
 



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