[gxml] Fixes to compile against Vala 0.36 master
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Fixes to compile against Vala 0.36 master
- Date: Mon, 12 Dec 2016 16:51:56 +0000 (UTC)
commit 7c90aa13d21d138b1c87a495d3f449fe50ea3303
Author: Daniel Espinosa <esodan gmail com>
Date: Mon Dec 12 10:49:57 2016 -0600
Fixes to compile against Vala 0.36 master
At this moment, there are some bugs on Vala 0.36, generating
VAPI code for libgee and valadoc failing to compile against vala
0.36, but no error exists on GXml code.
gxml/GXmlDocument.vala | 6 +++---
gxml/GXmlNode.vala | 6 +++---
gxml/GomDocument.vala | 2 +-
gxml/Node.vala | 6 +++---
gxml/TDocument.vala | 4 ++--
gxml/TNode.vala | 8 ++++----
6 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/gxml/GXmlDocument.vala b/gxml/GXmlDocument.vala
index 258945c..06f028f 100644
--- a/gxml/GXmlDocument.vala
+++ b/gxml/GXmlDocument.vala
@@ -92,9 +92,9 @@ public class GXml.GDocument : GXml.GNode,
return false;
}
// GXml.Node
- public override Gee.Map<string,GXml.Node> attrs { owned get { return new GHashMapAttr (this, (Xml.Node*)
doc); } }
- public override Gee.BidirList<GXml.Node> children_nodes { owned get { return new GListChildren (this,
(Xml.Node*) doc); } }
- public override Gee.List<GXml.Namespace> namespaces { owned get { return new GListNamespaces (this,
(Xml.Node*) doc); } }
+ public override Gee.Map<string,GXml.Node> attrs { owned get { return new GHashMapAttr (this, (Xml.Node*)
doc) as Gee.Map<string,GXml.Node>; } }
+ public override Gee.BidirList<GXml.Node> children_nodes { owned get { return new GListChildren (this,
(Xml.Node*) doc) as Gee.BidirList<GXml.Node>; } }
+ public override Gee.List<GXml.Namespace> namespaces { owned get { return new GListNamespaces (this,
(Xml.Node*) doc) as Gee.List<GXml.Namespace>; } }
public override GXml.Document document { get { return this; } }
// GXml.Document
public bool indent { get; set; default = false; }
diff --git a/gxml/GXmlNode.vala b/gxml/GXmlNode.vala
index 504cf1d..2614cd6 100644
--- a/gxml/GXmlNode.vala
+++ b/gxml/GXmlNode.vala
@@ -55,9 +55,9 @@ public abstract class GXml.GNode : Object,
if (_node == null) return false;
return ((_node->new_ns (uri, prefix)) != null);
}
- public virtual Gee.Map<string,GXml.Node> attrs { owned get { return new GHashMapAttr (_doc, _node); } }
- public virtual Gee.BidirList<GXml.Node> children_nodes { owned get { return new GListChildren (_doc,
_node); } }
- public virtual Gee.List<GXml.Namespace> namespaces { owned get { return new GListNamespaces (_doc, _node);
} }
+ public virtual Gee.Map<string,GXml.Node> attrs { owned get { return new GHashMapAttr (_doc, _node) as
Gee.Map<string,GXml.Node>; } }
+ public virtual Gee.BidirList<GXml.Node> children_nodes { owned get { return new GListChildren (_doc,
_node) as Gee.BidirList<GXml.Node>; } }
+ public virtual Gee.List<GXml.Namespace> namespaces { owned get { return new GListNamespaces (_doc, _node)
as Gee.List<GXml.Namespace>; } }
public virtual GXml.Document document { get { return _doc; } }
public virtual GXml.Node parent {
owned get {
diff --git a/gxml/GomDocument.vala b/gxml/GomDocument.vala
index fe30e42..979a188 100644
--- a/gxml/GomDocument.vala
+++ b/gxml/GomDocument.vala
@@ -71,7 +71,7 @@ public class GXml.GomDocument : GomNode,
public GomDocument () {}
public GomDocument.from_path (string path) throws GLib.Error {
var file = GLib.File.new_for_path (path);
- from_file (file);
+ this.from_file (file);
}
public GomDocument.from_uri (string uri) throws GLib.Error {
diff --git a/gxml/Node.vala b/gxml/Node.vala
index d05f13a..dda37bd 100644
--- a/gxml/Node.vala
+++ b/gxml/Node.vala
@@ -81,7 +81,7 @@ public interface GXml.Node : Object
var list = new GXml.ElementList ();
foreach (var child in children_nodes) {
if (child is GXml.Element) {
- list.add_all (child.get_elements_by_property_value (property, value));
+ (list as Collection<Element>).add_all (child.get_elements_by_property_value (property, value) as
Collection<Element>);
if (child.attrs == null) continue;
var cls = child.attrs.get (property);
if (cls == null) {
@@ -103,7 +103,7 @@ public interface GXml.Node : Object
if (!(this is GXml.Element || this is GXml.Document)) return list;
foreach (var child in children_nodes) {
if (child is GXml.Element) {
- list.add_all (child.get_elements_by_name (name));
+ (list as Collection<Element>).add_all (child.get_elements_by_name (name) as Collection<Element>);
if (name == child.name)
list.add ((GXml.Element) child);
}
@@ -120,7 +120,7 @@ public interface GXml.Node : Object
if (!(this is GXml.Element || this is GXml.Document)) return list;
foreach (var child in children_nodes) {
if (child is GXml.Element) {
- list.add_all (child.get_elements_by_name (name));
+ (list as Collection<Element>).add_all (child.get_elements_by_name (name) as Collection<Element>);
if (!(child.namespaces == null && child.namespaces.size != 0
&& ns == null)) continue;
if (name == child.name && child.namespaces.get(0).uri == ns)
diff --git a/gxml/TDocument.vala b/gxml/TDocument.vala
index 835404e..9722ac0 100644
--- a/gxml/TDocument.vala
+++ b/gxml/TDocument.vala
@@ -64,7 +64,7 @@ public class GXml.TDocument : GXml.TNode, GXml.Document
public TDocument.from_string (string str) {
var minput = new GLib.MemoryInputStream ();
minput.add_data ((uint8[]) str.dup (), null);
- TDocument.from_stream (minput);
+ this.from_stream (minput);
}
@@ -92,7 +92,7 @@ public class GXml.TDocument : GXml.TNode, GXml.Document
public TDocument.from_string_with_readtype_func (string str, ReadTypeFunc func) {
var minput = new GLib.MemoryInputStream ();
minput.add_data ((uint8[]) str.dup (), null);
- TDocument.from_stream_with_readtype_func (minput, func);
+ this.from_stream_with_readtype_func (minput, func);
}
// GXml.Node
diff --git a/gxml/TNode.vala b/gxml/TNode.vala
index ecfba7b..f480915 100644
--- a/gxml/TNode.vala
+++ b/gxml/TNode.vala
@@ -53,11 +53,11 @@ public abstract class GXml.TNode : Object, GXml.Node
return true;
}
public virtual string to_string () { return get_type ().name (); }
- public virtual Gee.Map<string,GXml.Node> attrs { owned get { return new Gee.HashMap<string,GXml.Node> ();
} }
- public virtual Gee.BidirList<GXml.Node> children_nodes { owned get { return new TChildrenList (this); } }
+ public virtual Gee.Map<string,GXml.Node> attrs { owned get { return new Gee.HashMap<string,GXml.Node> ()
as Gee.Map<string,GXml.Node>; } }
+ public virtual Gee.BidirList<GXml.Node> children_nodes { owned get { return new TChildrenList (this) as
Gee.BidirList<GXml.Node>; } }
public virtual GXml.Document document { get { return _doc; } }
public virtual string name { owned get { return _name.dup (); } }
- public virtual Gee.List<GXml.Namespace> namespaces { owned get { return new Gee.ArrayList<GXml.Node> (); }
}
+ public virtual Gee.List<GXml.Namespace> namespaces { owned get { return new Gee.ArrayList<GXml.Node> () as
Gee.List<GXml.Namespace>; } }
public virtual GXml.NodeType type_node { get { return _node_type; } }
public virtual string value { owned get { return _value.dup (); } set { _value = value; } }
public virtual GXml.Node parent {
@@ -72,7 +72,7 @@ public abstract class GXml.TNode : Object, GXml.Node
private GXml.Node _parent;
private Gee.ArrayList<GXml.Node> list = new Gee.ArrayList<GXml.Node> ();
- protected TChildrenList (GXml.Node e) {
+ public TChildrenList (GXml.Node e) {
_parent = e;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]