From 618a391346763603ef8e1d77f17a7fb6a6538772 Mon Sep 17 00:00:00 2001 From: nick_m Date: Sat, 9 Apr 2016 03:21:13 +1000 Subject: Preformance - reinstate EditorRegions::freeze_tree_model (). --- gtk2_ardour/editor_regions.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gtk2_ardour/editor_regions.cc') diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index c6620958c6..f95e5b797e 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -255,6 +255,8 @@ EditorRegions::EditorRegions (Editor* e) ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::region_changed, this, _1, _2), gui_context()); ARDOUR::RegionFactory::CheckNewRegion.connect (check_new_region_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::add_region, this, _1), gui_context()); + e->EditorFreeze.connect (editor_freeze_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::freeze_tree_model, this), gui_context()); + e->EditorThaw.connect (editor_thaw_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::thaw_tree_model, this), gui_context()); } bool @@ -1406,6 +1408,25 @@ EditorRegions::get_single_selection () return (*iter)[_columns.region]; } +void +EditorRegions::freeze_tree_model (){ + + _display.set_model (Glib::RefPtr(0)); + _model->set_sort_column (-2, SORT_ASCENDING); //Disable sorting to gain performance + +} + +void +EditorRegions::thaw_tree_model (){ + + _model->set_sort_column (0, SORT_ASCENDING); // renabale sorting + _display.set_model (_model); + + if (toggle_full_action()->get_active()) { + _display.expand_all(); + } +} + void EditorRegions::locked_changed (std::string const & path) { -- cgit v1.2.3