svn commit: samba r21808 - in branches/SAMBA_4_0/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm: .

derrell at samba.org derrell at samba.org
Tue Mar 13 02:51:50 GMT 2007


Author: derrell
Date: 2007-03-13 02:51:49 +0000 (Tue, 13 Mar 2007)
New Revision: 21808

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21808

Log:

- Fix a nasty bug in the finite state machine that allowed an event from a
  non-handled widget to be processed as if the event originated from a handled
  widget.  This was allowing the appear event for the module's canvas in
  Mimir's Net Manager (an event which was not handled) to load the tree,
  followed by the tree appear event (intended to be handled, albeit
  incorrectly -- see subsequent check-in of Mimir's Fsm.js) to again load the
  tree, thus the double entry.

  Wow, the above paragraph is really hard to read. :-)

Modified:
   branches/SAMBA_4_0/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js


Changeset:
Modified: branches/SAMBA_4_0/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js
===================================================================
--- branches/SAMBA_4_0/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js	2007-03-13 01:47:04 UTC (rev 21807)
+++ branches/SAMBA_4_0/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js	2007-03-13 02:51:49 UTC (rev 21808)
@@ -220,6 +220,13 @@
   // Save the old state object, so we can return it to be disposed
   var oldState = this._states[stateName];
 
+  // Ensure the old state exists.  Otherwise, shouldn't be using replaceState()
+  if (! oldState)
+  {
+    throw new Error("Can not replace state " + stateName + ": " +
+                    "no existing state of that name.");
+  }
+
   // Replace the old state with the new state object.
   this._states[stateName] = state;
 
@@ -227,7 +234,7 @@
   if (bDispose)
   {
     // Yup.  Mark it to be disposed.
-    oldState._needDispose;
+    oldState._bNeedDispose = true;
   }
 
   return oldState;
@@ -787,6 +794,18 @@
     }
 
     action = e[friendly];
+
+    // Do we handle this event type for the widget from which it originated?
+    if (! action)
+    {
+      // Nope.
+      if (debugEvents)
+      {
+        this.debug(this.getName() + ": Event '" + event.getType() + "'" +
+                   " not handled for target " + friendly + ".  Ignoring.");
+      }
+      return true;
+    }
   }
   else
   {
@@ -946,7 +965,7 @@
     currentState.getAutoActionsAfterOnexit()(this);
 
     // If this state has been replaced and we're supposed to dispose it...
-    if (currentState._needDispose)
+    if (currentState._bNeedDispose)
     {
       // ... then dispose it now that it's no longer in use
       currentState.dispose();



More information about the samba-cvs mailing list