added module ds cache on a session basis

git-svn-id: file:///home/svn/framework3/trunk@4399 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2007-02-16 06:40:55 +00:00
parent ddb22785ee
commit 96a6131bf0
1 changed files with 18 additions and 0 deletions

View File

@ -73,6 +73,15 @@ class Core
}
end
#
# Initializes the datastore cache
#
def initialize(driver)
super
@dscache = {}
end
#
# Returns the name of the command dispatcher.
#
@ -91,6 +100,10 @@ class Core
if (active_module)
active_module.reset_ui
# Save the module's datastore so that we can load it later
# if the module is used again
@dscache[active_module.fullname] = active_module.datastore.dup
self.active_module = nil
end
@ -1043,6 +1056,11 @@ class Core
# Update the active module
self.active_module = mod
# If a datastore cache exists for this module, then load it up
if @dscache[active_module.fullname]
active_module.datastore.update(@dscache[active_module.fullname])
end
mod.init_ui(driver.input, driver.output)