diff options
author | Derrell Lipman <derrell@samba.org> | 2007-03-13 02:51:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:49:30 -0500 |
commit | 3330a53acc602ee64fef77608a4dfb8774ea3151 (patch) | |
tree | 861abcd0b9a3d359f719981c5ef029469a077d12 | |
parent | 676a04a056d495b9b81ba7c6e6b1cbb9c3d64ac5 (diff) | |
download | samba-3330a53acc602ee64fef77608a4dfb8774ea3151.tar.gz samba-3330a53acc602ee64fef77608a4dfb8774ea3151.tar.bz2 samba-3330a53acc602ee64fef77608a4dfb8774ea3151.zip |
r21808: - 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. :-)
(This used to be commit 512dc61e846669311b1605c6c4e1b49241c1c8be)
-rw-r--r-- | webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js index 0b42bc24be..dd25b32ba0 100644 --- a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/util/fsm/FiniteStateMachine.js @@ -220,6 +220,13 @@ qx.Proto.replaceState = function(state, bDispose) // 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 @@ qx.Proto.replaceState = function(state, bDispose) if (bDispose) { // Yup. Mark it to be disposed. - oldState._needDispose; + oldState._bNeedDispose = true; } return oldState; @@ -787,6 +794,18 @@ qx.Proto._run = function(event) } 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 @@ qx.Proto._run = function(event) 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(); |