From c9420126f1743555f69e1a16404065394cb4ff6c Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 10 Jan 2009 11:08:48 +0000 Subject: [PATCH] Retired iteration through the model tree in header container --- .../timeline/timeline-header-container.cpp | 32 +++---------------- .../timeline/timeline-header-container.hpp | 24 +------------- 2 files changed, 6 insertions(+), 50 deletions(-) diff --git a/src/gui/widgets/timeline/timeline-header-container.cpp b/src/gui/widgets/timeline/timeline-header-container.cpp index 171620cc7..7641c69d2 100644 --- a/src/gui/widgets/timeline/timeline-header-container.cpp +++ b/src/gui/widgets/timeline/timeline-header-container.cpp @@ -74,7 +74,7 @@ TimelineHeaderContainer::TimelineHeaderContainer( void TimelineHeaderContainer::update_headers() -{ +{ // Ensure headers are parented correctly pair, shared_ptr > pair; BOOST_FOREACH( pair, timelineWidget.trackMap ) @@ -274,10 +274,11 @@ TimelineHeaderContainer::forall_vfunc(gboolean /* include_internals */, { REQUIRE(callback != NULL); - BOOST_FOREACH( shared_ptr track, get_tracks() ) + pair, shared_ptr > pair; + BOOST_FOREACH( pair, timelineWidget.trackMap ) { - REQUIRE(track); - forall_vfunc_recursive(track, callback, callback_data); + REQUIRE(pair.second); + callback(pair.second->get_header_widget().gobj(), callback_data); } } @@ -394,22 +395,6 @@ TimelineHeaderContainer::layout_headers() queue_draw (); } -void -TimelineHeaderContainer::forall_vfunc_recursive( - shared_ptr model_track, GtkCallback callback, - gpointer callback_data) -{ - REQUIRE(callback != NULL); - - callback( lookup_timeline_track(model_track)-> - get_header_widget().gobj(), callback_data) ; - - // Recurse through all the children - BOOST_FOREACH( shared_ptr child, - model_track->get_child_tracks() ) - forall_vfunc_recursive(child, callback, callback_data); -} - void TimelineHeaderContainer::draw_header_decoration( shared_ptr model_track, @@ -524,13 +509,6 @@ TimelineHeaderContainer::lookup_timeline_track( return timeline_track; } -const std::list< boost::shared_ptr > -TimelineHeaderContainer::get_tracks() const -{ - REQUIRE(timelineWidget.sequence); - return timelineWidget.sequence->get_child_tracks(); -} - void TimelineHeaderContainer::register_styles() const { diff --git a/src/gui/widgets/timeline/timeline-header-container.hpp b/src/gui/widgets/timeline/timeline-header-container.hpp index 0ba97d0fe..23c75eb37 100644 --- a/src/gui/widgets/timeline/timeline-header-container.hpp +++ b/src/gui/widgets/timeline/timeline-header-container.hpp @@ -152,18 +152,7 @@ private: * stacking etc. */ void layout_headers(); - - /** - * Recursively calls a callback on all the header widgets in a branch. - * @param model_track The root track of the branch. - * @param callback The callback to apply to the branch. This includes - * model_track and all it's children. - * @param callback_data The user data parameter for the callback. - **/ - void forall_vfunc_recursive( - boost::shared_ptr model_track, - GtkCallback callback, gpointer callback_data); - + /** * Draws the border decoration around the track header. * @param model_track The track to draw the decoration for. @@ -207,17 +196,6 @@ private: **/ boost::shared_ptr lookup_timeline_track( boost::shared_ptr model_track); - - /** - * A helper function which calls get_tracks within the sequence of the - * parent timeline widget, but also applies lots of data consistency - * checks in the process. - * @param model_track The model track to look up in the parent widget. - * @return Returns the track found, or returns NULL if no matching - * track was found. - **/ - const std::list< boost::shared_ptr > - get_tracks() const; /** * Registers all the styles that this class will respond to.