[rkward-cvs] [rkward/work/distributions] /: Document that later <set>-elements will override earlier ones.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Jan 22 17:30:28 UTC 2015


Git commit 625600cf34118352ba978624cee775ed04c03c1d by Thomas Friedrichsmeier.
Committed on 22/01/2015 at 17:30.
Pushed by tfry into branch 'work/distributions'.

Document that later <set>-elements will override earlier ones.

M  +5    -2    doc/rkwardplugins/index.docbook
M  +7    -6    rkward/plugin/rkstandardcomponent.cpp

http://commits.kde.org/rkward/625600cf34118352ba978624cee775ed04c03c1d

diff --git a/doc/rkwardplugins/index.docbook b/doc/rkwardplugins/index.docbook
index 371280e..4da8d3d 100644
--- a/doc/rkwardplugins/index.docbook
+++ b/doc/rkwardplugins/index.docbook
@@ -50,6 +50,7 @@ as Authors, publish date, the abstract, and Keywords -->
 <year>2012</year>
 <year>2013</year>
 <year>2014</year>
+<year>2015</year>
 <holder>Thomas Friedrichsmeier</holder>
 </copyright>
 <!-- Translators: put here the copyright notice of the translation -->
@@ -57,7 +58,7 @@ as Authors, publish date, the abstract, and Keywords -->
      and in the FDL itself on how to use it. -->
 <legalnotice>&FDLNotice;</legalnotice>
 
-<date>2014-12-18</date>
+<date>2015-01-22</date>
 <releaseinfo>0.6.300</releaseinfo>
 
 <abstract>
@@ -3324,7 +3325,9 @@ Child-elements:
 
 <varlistentry>
 <term><set></term>
-<listitem><para>Set a property to a fixed value (of course, if you additionally connect the property to some other property, the value does not remain fixed). For instance, if you embed a plugin, but want to hide some of its elements, you might set the visibility property of those elements to false. Useful esp. for embedded/embedding plugins. Attributes:
+<listitem><para>Set a property to a fixed value (of course, if you additionally connect the property to some other property, the value does not remain fixed). For instance, if you embed a plugin, but want to hide some of its elements, you might set the visibility property of those elements to false. Useful esp. for embedded/embedding plugins. Note: If there are several <set> elements
+for a single <parameter>id</parameter>, the latest one to be defined takes precendence. This will sometimes be useful to rely on when using <include>d parts.
+Attributes:
 	<variablelist>
 	<varlistentry>
 	<term><parameter>id</parameter></term>
diff --git a/rkward/plugin/rkstandardcomponent.cpp b/rkward/plugin/rkstandardcomponent.cpp
index 0902499..5f48925 100644
--- a/rkward/plugin/rkstandardcomponent.cpp
+++ b/rkward/plugin/rkstandardcomponent.cpp
@@ -710,11 +710,6 @@ void RKComponentBuilder::parseLogic (const QDomElement &element, XMLHelper &xml,
 		addConnection (xml.getStringAttribute (*it, "client", "#noid#", DL_WARNING), QString::null, xml.getStringAttribute (*it, "governor", "#noid#", DL_WARNING), QString::null, xml.getBoolAttribute (*it, "reconcile", false, DL_INFO), element);
 	}
 
-	// find initialize elements
-	children = xml.getChildElements (element, "set", DL_INFO);
-	for (it = children.constBegin (); it != children.constEnd (); ++it) {
-		initial_values.insert (xml.getStringAttribute (*it, "id", "#noid#", DL_WARNING), xml.getStringAttribute (*it, "to", "false", DL_WARNING));
-	}
 	children = xml.getChildElements (element, "dependency_check", DL_INFO);
 	for (it = children.constBegin (); it != children.constEnd (); ++it) {
 		RKComponentPropertyBool *dep = new RKComponentPropertyBool (component (), false);
@@ -736,7 +731,13 @@ void RKComponentBuilder::parseLogic (const QDomElement &element, XMLHelper &xml,
 		if (!dummy.isNull ()) {
 			initial_values.insert (id, dummy);
 		}
-		// TODO add more options
+	}
+
+	// find initialize elements
+	children = xml.getChildElements (element, "set", DL_INFO);
+	for (it = children.constBegin (); it != children.constEnd (); ++it) {
+		// NOTE: It is by design that if there are several initializations for a single id, the latest one takes precedence. Useful in some cases of inclusion.
+		initial_values.insert (xml.getStringAttribute (*it, "id", "#noid#", DL_WARNING), xml.getStringAttribute (*it, "to", "false", DL_WARNING));
 	}
 
 	// find convert elements


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
rkward-cvs mailing list
rkward-cvs at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-cvs


More information about the rkward-tracker mailing list