[rkward-cvs] SF.net SVN: rkward:[3734] trunk/rkward/rkward/plugin

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Sep 9 09:15:56 UTC 2011


Revision: 3734
          http://rkward.svn.sourceforge.net/rkward/?rev=3734&view=rev
Author:   tfry
Date:     2011-09-09 09:15:55 +0000 (Fri, 09 Sep 2011)
Log Message:
-----------
Make isSatisfied() non-virtual

Modified Paths:
--------------
    trunk/rkward/rkward/plugin/rkcomponent.cpp
    trunk/rkward/rkward/plugin/rkcomponent.h
    trunk/rkward/rkward/plugin/rkformula.cpp
    trunk/rkward/rkward/plugin/rkformula.h

Modified: trunk/rkward/rkward/plugin/rkcomponent.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkcomponent.cpp	2011-09-09 08:56:32 UTC (rev 3733)
+++ trunk/rkward/rkward/plugin/rkcomponent.cpp	2011-09-09 09:15:55 UTC (rev 3734)
@@ -256,8 +256,9 @@
 
 bool RKComponent::isValid () {
 	RK_TRACE (PLUGIN);
-#warning TODO: I do not think we need this. Use recursiveStatus, instead
 
+	// TODO: It's sort of lame to iterate over all children, here, as typically this is called indirectly from recursiveStatus(), and that iterates over the children, too.
+	// However, iterating over the children is required to make isSatisfied() return a sensible answer.
 	for (QHash<QString, RKComponentBase*>::const_iterator it = child_map.constBegin (); it != child_map.constEnd (); ++it) {
 		if (!(it.value ()->isSatisfied ())) return false;
 	}

Modified: trunk/rkward/rkward/plugin/rkcomponent.h
===================================================================
--- trunk/rkward/rkward/plugin/rkcomponent.h	2011-09-09 08:56:32 UTC (rev 3733)
+++ trunk/rkward/rkward/plugin/rkcomponent.h	2011-09-09 09:15:55 UTC (rev 3734)
@@ -89,7 +89,7 @@
 	bool isProperty () { return (type () <= PropertyEnd); };
 	bool isComponent () { return (type () >= ComponentBase); };
 /** returns satisfaction state. see setRequired () */
-	virtual bool isSatisfied ();
+	bool isSatisfied ();
 /** returns somewhat more elaborate state than isSatisfied(). (Effectively identical in the base class). */
 	virtual ComponentStatus recursiveStatus ();
 /** currently valid (i.e. satisfied, even if required)? default implementation always returns true */

Modified: trunk/rkward/rkward/plugin/rkformula.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkformula.cpp	2011-09-09 08:56:32 UTC (rev 3733)
+++ trunk/rkward/rkward/plugin/rkformula.cpp	2011-09-09 09:15:55 UTC (rev 3734)
@@ -399,7 +399,7 @@
 	}
 }
 
-bool RKFormula::isSatisfied () {
+bool RKFormula::isValid () {
 	RK_TRACE (PLUGIN);
 	return (model_ok);
 }

Modified: trunk/rkward/rkward/plugin/rkformula.h
===================================================================
--- trunk/rkward/rkward/plugin/rkformula.h	2011-09-09 08:56:32 UTC (rev 3733)
+++ trunk/rkward/rkward/plugin/rkformula.h	2011-09-09 09:15:55 UTC (rev 3734)
@@ -41,7 +41,7 @@
 	~RKFormula ();
 
 	QString value (const QString &modifier) { return model->value (modifier); };
-	bool isSatisfied ();
+	bool isValid ();
 
 /** RTTI */
 	int type () { return ComponentFormula; };

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list