comparison gui/src/history-dockwidget.cc @ 14750:4812bcd524a1 gui

Fixed flooding the event queue by only an event after the last one has been processed. * history-dockwidget.cc: Set update timer to single shot and starting timer again after an event. * octave-link.cc: Flushing event queue before exiting. * workspace-model.cc: Set update timer to single shot and starting timer again after an update event has been received.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Fri, 08 Jun 2012 19:13:50 +0200
parents cecc7da96e2a
children 9d9eb9bac65e
comparison
equal deleted inserted replaced
14749:06bd3610f76e 14750:4812bcd524a1
45 QString (command_history::get_entry (i).c_str ())); 45 QString (command_history::get_entry (i).c_str ()));
46 } 46 }
47 } 47 }
48 } 48 }
49 49
50 // Post a new update event in a given time. This prevents flooding the
51 // event queue.
52 _update_history_model_timer.start ();
50 delete e; 53 delete e;
51 } 54 }
52 55
53 void 56 void
54 history_dock_widget::event_reject (octave_event *e) 57 history_dock_widget::event_reject (octave_event *e)
93 SIGNAL (visibilityChanged (bool)), 96 SIGNAL (visibilityChanged (bool)),
94 this, 97 this,
95 SLOT (handle_visibility_changed (bool))); 98 SLOT (handle_visibility_changed (bool)));
96 99
97 _update_history_model_timer.setInterval (200); 100 _update_history_model_timer.setInterval (200);
98 _update_history_model_timer.setSingleShot (false); 101 _update_history_model_timer.setSingleShot (true);
99 102
100 connect (&_update_history_model_timer, 103 connect (&_update_history_model_timer,
101 SIGNAL (timeout ()), 104 SIGNAL (timeout ()),
102 this, 105 this,
103 SLOT (request_history_model_update ())); 106 SLOT (request_history_model_update ()));