[gxml] Removed SerializableValueList from SerializableObjectModel



commit 78353f463a7b5b851807e10901cf48d390e794d1
Author: Daniel Espinosa <esodan gmail com>
Date:   Sun Nov 1 12:45:40 2015 -0600

    Removed SerializableValueList from SerializableObjectModel

 gxml/SerializableObjectModel.vala |   16 ++++++++++------
 gxml/SerializableProperty.vala    |    2 +-
 gxml/SerializableValueList.vala   |    4 ++--
 3 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/gxml/SerializableObjectModel.vala b/gxml/SerializableObjectModel.vala
index f5310b3..24e3d56 100644
--- a/gxml/SerializableObjectModel.vala
+++ b/gxml/SerializableObjectModel.vala
@@ -210,7 +210,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
                                         GLib.ParamSpec prop)
                                         throws GLib.Error
   {
-    if (prop.value_type.is_a (typeof (Serializable))) 
+    if (prop.value_type.is_a (typeof (Serializable)) || prop.value_type.is_a (typeof 
(SerializableProperty))) 
     {
       var v = Value (typeof (Object));
       get_property (prop.name, ref v);
@@ -405,7 +405,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
 #if DEBUG
           GLib.message (@"Checking if $(property_node.name) of type $(prop.value_type.name ()) is 
Serializable");
 #endif
-    if (prop.value_type.is_a (typeof (Serializable)))
+    if (prop.value_type.is_a (typeof (Serializable)) || prop.value_type.is_a (typeof (SerializableProperty)))
     {
 #if DEBUG
       GLib.message (@"'$(property_node.name)'- $(prop.value_type.name ()) - Is Serializable: deserializing");
@@ -415,12 +415,16 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
       GLib.Object object = null;
       object = vobj.get_object ();
       if (object == null) {
-        var obj = Object.new  (prop.value_type);
-        if (obj is SerializableProperty)
+        if (prop.value_type.is_a (typeof (SerializableProperty))) {
+          var obj = Object.new  (prop.value_type);
           ((SerializableProperty) obj).deserialize_property (property_node, prop, property_use_nick ());
-        else
+          set_property (prop.name, obj);
+        }
+        else if (prop.value_type.is_a (typeof (Serializable))) {
+          var obj = Object.new  (prop.value_type);
           ((Serializable) obj).deserialize (property_node);
-        set_property (prop.name, obj);
+          set_property (prop.name, obj);
+        }
       }
       else {
         if (object is SerializableProperty)
diff --git a/gxml/SerializableProperty.vala b/gxml/SerializableProperty.vala
index 4d41d18..94941dc 100644
--- a/gxml/SerializableProperty.vala
+++ b/gxml/SerializableProperty.vala
@@ -33,7 +33,7 @@ using Gee;
  * when parsing { link GXml.Attribute} properties values and to exclude to be serialized if they have not
  * been created in the holding objects.
  */
-public interface GXml.SerializableProperty : Object, Serializable
+public interface GXml.SerializableProperty : Object
 {
   /**
   * Value to be set to a { link GXml.Attribute}, to be added to a { link GXml.Element}
diff --git a/gxml/SerializableValueList.vala b/gxml/SerializableValueList.vala
index bb7f207..9c67b4e 100644
--- a/gxml/SerializableValueList.vala
+++ b/gxml/SerializableValueList.vala
@@ -33,7 +33,7 @@ using Gee;
  * { link GXml.SerializableValueList._vals}, at construct {} clause to point a fixed
  * array of strings.
  */
-public class GXml.SerializableValueList : SerializableObjectModel, SerializableProperty
+public class GXml.SerializableValueList : Object, SerializableProperty
 {
   
   private string _val = null;
@@ -102,5 +102,5 @@ public class GXml.SerializableValueList : SerializableObjectModel, SerializableP
   }
   public string get_serializable_property_value () { return _val; }
   public void set_serializable_property_value (string? val) { _val = val; }
-  public override string to_string () { return _val; }
+  public string to_string () { return _val; }
 }
\ No newline at end of file


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