[rkward-cvs] SF.net SVN: rkward:[3667] trunk/rkward/rkward/plugin/rkcomponent.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sat Jun 4 09:30:09 UTC 2011


Revision: 3667
          http://rkward.svn.sourceforge.net/rkward/?rev=3667&view=rev
Author:   tfry
Date:     2011-06-04 09:30:09 +0000 (Sat, 04 Jun 2011)

Log Message:
-----------
If a component is disabled in the GUI, it is non-required, implicitly.
Not sure, whether this assumption is currently violated anywhere, but where it is, that is definitely a bug.
TODO: This should allow to do away with a lot of connections to the required property.

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

Modified: trunk/rkward/rkward/plugin/rkcomponent.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkcomponent.cpp	2011-06-03 18:18:26 UTC (rev 3666)
+++ trunk/rkward/rkward/plugin/rkcomponent.cpp	2011-06-04 09:30:09 UTC (rev 3667)
@@ -158,6 +158,7 @@
 
 	bool processing = false;
 	bool children_satisfied = true;
+	// we always need to interate over all children, since we need to make sure to find any which are dead or processing.
 	for (QHash<QString, RKComponentBase*>::const_iterator it = child_map.constBegin (); it != child_map.constEnd (); ++it) {
 		ComponentStatus s = it.value ()->recursiveStatus ();
 		if (s == Dead) return Dead;
@@ -165,7 +166,9 @@
 		else if (s != Satisfied) children_satisfied = false;
 	}
 	if (processing) return Processing;
-	if (!required) return Satisfied;
+	bool req = required;
+	if (isComponent ()) req = req & static_cast<RKComponent*>(this)->isEnabled ();
+	if (!req) return Satisfied;
 	if (children_satisfied && isSatisfied ()) return Satisfied;
 	return Unsatisfied;
 }
@@ -247,6 +250,7 @@
 	RK_TRACE (PLUGIN);
 #warning TODO: I do not think we need this. Use recursiveStatus, instead
 
+	if (!isEnabled ()) return true;
 	for (QHash<QString, RKComponentBase*>::const_iterator it = child_map.constBegin (); it != child_map.constEnd (); ++it) {
 		if (!(it.value ()->isSatisfied ())) return false;
 	}


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