fix ordering of track view list & route list resync in editor, to avoid clearing track view list in the middle of a list traversal

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4803 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-03-12 14:15:28 +00:00
parent 2f199ac0ae
commit d4be58825b
2 changed files with 24 additions and 4 deletions

View file

@ -1769,6 +1769,7 @@ public:
void redisplay_route_list();
bool ignore_route_list_reorder;
bool no_route_list_redisplay;
bool sync_track_view_list_and_route_list ();
void build_route_list_menu ();
void show_route_list_menu ();

View file

@ -295,14 +295,10 @@ Editor::redisplay_route_list ()
return;
}
track_views.clear (); // we will reload as we go along
for (n = 0, order = 0, position = 0, i = rows.begin(); i != rows.end(); ++i) {
TimeAxisView *tv = (*i)[route_display_columns.tv];
boost::shared_ptr<Route> route = (*i)[route_display_columns.route];
track_views.push_back (tv);
if (tv == 0) {
// just a "title" row
continue;
@ -332,6 +328,13 @@ Editor::redisplay_route_list ()
++n;
}
/* whenever we go idle, update the track view list to reflect the new order.
we can't do this here, because we could mess up something that is traversing
the track order and has caused a redisplay of the list.
*/
Glib::signal_idle().connect (mem_fun (*this, &Editor::sync_track_view_list_and_route_list));
full_canvas_height = position + canvas_timebars_vsize;
vertical_adjustment.set_upper (full_canvas_height);
if ((vertical_adjustment.get_value() + canvas_height) > vertical_adjustment.get_upper()) {
@ -347,6 +350,22 @@ Editor::redisplay_route_list ()
}
}
bool
Editor::sync_track_view_list_and_route_list ()
{
TreeModel::Children rows = route_display_model->children();
TreeModel::Children::iterator i;
track_views.clear ();
for (i = rows.begin(); i != rows.end(); ++i) {
TimeAxisView *tv = (*i)[route_display_columns.tv];
track_views.push_back (tv);
}
return false; // do not call again (until needed)
}
void
Editor::hide_all_tracks (bool with_select)
{