[nemiver] 689338 - Sometimes current frame is wrongly set
- From: Dodji Seketeli <dodji src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver] 689338 - Sometimes current frame is wrongly set
- Date: Sat, 1 Dec 2012 22:00:27 +0000 (UTC)
commit e6ae268cdcb5fcd52ce5b37408365e51e61f7881
Author: Dodji Seketeli <dodji seketeli org>
Date: Fri Nov 30 11:22:07 2012 +0100
689338 - Sometimes current frame is wrongly set
* src/persp/dbgperspective/nmv-call-stack.cc
(CallStack::Priv::set_current_frame): Properly update the
CallStack::Priv::cur_frame_index member variable. That way, when
the CallStack::frame_selected_signal is emitted (in
on_command_done_signal), the frame index that is advertised is
going to be correct. Note that the advertised index is not yet
used, but still. This change makes the code correct.
(CallStack::Priv::clear_frame_list): Block the execution of the
on_selection_changed callback slot upon clearing of the list
store. That way, we ensure that no weird row gets randomly
selected.
(CallStack::Priv::on_selection_changed_signal): Don't try to act
on an empty list store.
src/persp/dbgperspective/nmv-call-stack.cc | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/persp/dbgperspective/nmv-call-stack.cc b/src/persp/dbgperspective/nmv-call-stack.cc
index b2b2ca4..d765fd4 100644
--- a/src/persp/dbgperspective/nmv-call-stack.cc
+++ b/src/persp/dbgperspective/nmv-call-stack.cc
@@ -229,14 +229,15 @@ struct CallStack::Priv {
set_current_frame (unsigned a_index)
{
THROW_IF_FAIL (a_index < frames.size ());
- cur_frame = frames[a_index];
+ cur_frame_index = a_index;
+ cur_frame = frames[cur_frame_index];
THROW_IF_FAIL (cur_frame.level () >= 0);
in_set_cur_frame_trans = true;
LOG_DD ("frame selected: '"<< (int) cur_frame_index << "'");
LOG_DD ("frame level: '" << (int) cur_frame.level () << "'");
- debugger->select_frame (a_index);
+ debugger->select_frame (cur_frame_index);
}
/// If the selected frame is the "expand to see more frames" raw,
@@ -419,7 +420,11 @@ struct CallStack::Priv {
{
LOG_FUNCTION_SCOPE_NORMAL_DD;
- NEMIVER_TRY
+ NEMIVER_TRY;
+
+ // Don't try to select a row on an empty call stack.
+ if (store->children ().empty ())
+ return;
Gtk::TreeView *tree_view = dynamic_cast<Gtk::TreeView*> (widget.get ());
THROW_IF_FAIL (tree_view);
@@ -846,7 +851,12 @@ struct CallStack::Priv {
}
THROW_IF_FAIL (store);
+ // We really don't need to try to update the selected frame
+ // when we are just clearing the list store, so block the signal
+ // transmission to the callback slot while we clear the store.
+ on_selection_changed_connection.block ();
store->clear ();
+ on_selection_changed_connection.unblock ();
frames.clear ();
params.clear ();
level_frame_map.clear ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]