From 4479396c86bbfa849bd7f52b04088d0a0dcd2f32 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 12 Jan 2010 01:29:07 +0000 Subject: [PATCH] Clear all navigation history on change of database svn: r14039 --- src/DisplayState.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/DisplayState.py b/src/DisplayState.py index 0efcaad90..a528fd3e1 100644 --- a/src/DisplayState.py +++ b/src/DisplayState.py @@ -345,6 +345,13 @@ class DisplayState(gen.utils.Callback): # but this connection is still made! # self.dbstate.connect('database-changed', self.db_changed) + def clear_history(self): + """ + Clear all history objects. + """ + for history in self.history_lookup.values(): + history.clear() + def get_history(self, nav_type, nav_group=0): """ Return the history object for the given navigation type and group. @@ -381,6 +388,7 @@ class DisplayState(gen.utils.Callback): def db_changed(self, db): db.connect('long-op-start', self.progress_monitor.add_op) + self.clear_history() def set_relationship_class(self): """method that rebinds the relationship to the current rel calc