- Use a NotifyLock instead of (History|Simulation)::set_notify_enabled() method, which is more elegant and also exception-safe
- Delete set_notify_enabled() method from ConcreteHistory; it was both wrong and useless, and caused impredictable behaviour! - Don't make some methods of History and Simulation virtual if we don't want the user to override them - Loading from file and jumping to an instant of the simulation should be much quickier now git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1170 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
737324f250
commit
83b655496f
11 changed files with 94 additions and 73 deletions
|
@ -166,7 +166,7 @@ AddRequestDialog::run_edit(Request& request)
|
|||
{
|
||||
assert(_list_model->children());
|
||||
|
||||
bool was_enabled = history.set_notify_enabled(false);
|
||||
History::LockNotify h_lock(history);
|
||||
|
||||
// I know it's a bit hack-ish, but do you know an elegant alternative way?
|
||||
for(Iseq<vector<SubRequest*>::iterator> it = iseq(subrequests); it; ++it)
|
||||
|
@ -178,8 +178,6 @@ AddRequestDialog::run_edit(Request& request)
|
|||
|
||||
for(Iseq<TreeIter> it = iseq(sreq_container); it; ++it)
|
||||
history.add_subrequest(request, (*it)[_list_key_column], (*it)[_list_duration_column]);
|
||||
|
||||
history.set_notify_enabled(was_enabled);
|
||||
}
|
||||
|
||||
hide();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue