From 1203372f3e0d97274102989214388707e80f1995 Mon Sep 17 00:00:00 2001 From: tchernobog Date: Thu, 7 Sep 2006 09:56:56 +0000 Subject: [PATCH] - Small fix for the sake of code correctness git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1037 3ecf2c5c-341e-0410-92b4-d18e462d057c --- src/backend/history.cc | 6 ++++++ src/backend/sgpemv2/history.hh | 1 + src/jump_to_dialog.cc | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backend/history.cc b/src/backend/history.cc index af6e3ac..cf0c71c 100644 --- a/src/backend/history.cc +++ b/src/backend/history.cc @@ -82,3 +82,9 @@ History::set_notify_enabled(bool enabled) return old_value; } + +bool +History::is_notify_enabled() const +{ + return _notify; +} diff --git a/src/backend/sgpemv2/history.hh b/src/backend/sgpemv2/history.hh index 89bf3a8..545cf5e 100644 --- a/src/backend/sgpemv2/history.hh +++ b/src/backend/sgpemv2/history.hh @@ -143,6 +143,7 @@ namespace sgpem * \return The old value */ virtual bool set_notify_enabled(bool enabled = true); + bool is_notify_enabled() const; virtual void reset() = 0; diff --git a/src/jump_to_dialog.cc b/src/jump_to_dialog.cc index dcd5802..56f228f 100644 --- a/src/jump_to_dialog.cc +++ b/src/jump_to_dialog.cc @@ -84,13 +84,14 @@ JumpToDialog::_on_jump() History& h = sim.get_history(); sim.attach(*this); - h.set_notify_enabled(false); + bool reenable = h.is_notify_enabled(); try { if(_target_instant < h.get_size() - 1) sim.jump_to(_target_instant); else sim.jump_to(h.get_size() - 1); + h.set_notify_enabled(false); while(h.get_front() < _target_instant) { sim.run(); @@ -102,7 +103,7 @@ JumpToDialog::_on_jump() { // FIXME: correctly manage exceptions! } - h.set_notify_enabled(true); + h.set_notify_enabled(reenable); sim.detach(*this); _ok_button->set_sensitive(true);