[glibmm] Revert "Pass 0 (NULL) instead of for C properties."



commit d4c8ff44906d5dab2c219abcc3e08471a02dcfae
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Sep 8 20:02:42 2013 +0200

    Revert "Pass 0 (NULL) instead of  for C properties."
    
    This reverts commit db1668a39d9646882d5aa6b7386a3b7ea70f99af.

 glib/glibmm/objectbase.cc         |   12 ------------
 glib/glibmm/propertyproxy_base.cc |   15 +--------------
 2 files changed, 1 insertions(+), 26 deletions(-)
---
diff --git a/glib/glibmm/objectbase.cc b/glib/glibmm/objectbase.cc
index 047f192..140816a 100644
--- a/glib/glibmm/objectbase.cc
+++ b/glib/glibmm/objectbase.cc
@@ -260,18 +260,6 @@ bool ObjectBase::_cpp_destruction_is_in_progress() const
 
 void ObjectBase::set_property_value(const Glib::ustring& property_name, const Glib::ValueBase& value)
 {
-  const GValue* cvalue = value.gobj();
-  if(cvalue && G_VALUE_HOLDS(cvalue, G_TYPE_STRING))
-  {
-    const gchar* str = g_value_get_string (cvalue);
-    if(str && (strcmp(str, "") == 0))
-    {
-      //Pass NULL to the C API instead of "":
-      g_object_set(gobj(), property_name.c_str(), (void*)0, (void*)0);
-      return;
-    }
-  }
-
   g_object_set_property(gobj(), property_name.c_str(), value.gobj());
 }
 
diff --git a/glib/glibmm/propertyproxy_base.cc b/glib/glibmm/propertyproxy_base.cc
index 4274c65..0f1fac8 100644
--- a/glib/glibmm/propertyproxy_base.cc
+++ b/glib/glibmm/propertyproxy_base.cc
@@ -26,7 +26,6 @@
 #include <glibmm/signalproxy_connectionnode.h>
 #include <glibmm/object.h>
 #include <glibmm/private/object_p.h>
-#include <cstring>
 
 namespace Glib
 {
@@ -99,19 +98,7 @@ SignalProxyProperty PropertyProxy_Base::signal_changed()
 
 void PropertyProxy_Base::set_property_(const Glib::ValueBase& value)
 {
-  const GValue* cvalue = value.gobj();
-  if(cvalue && G_VALUE_HOLDS(cvalue, G_TYPE_STRING))
-  {
-    const gchar* str = g_value_get_string (cvalue);
-    if(str && (strcmp(str, "") == 0))
-    {
-      //Pass NULL to the C API instead of "":
-      g_object_set(obj_->gobj(), property_name_, (void*)0, (void*)0);
-      return;
-    }
-  }
-
-  g_object_set_property(obj_->gobj(), property_name_, cvalue);
+  g_object_set_property(obj_->gobj(), property_name_, value.gobj());
 }
 
 void PropertyProxy_Base::get_property_(Glib::ValueBase& value) const


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