minor fixes/changes based on comparison with existing bindings
[ardour.git] / gtk2_ardour / editor_route_groups.cc
index b459168dcb2ea3790daf116d4e6fe10586454227..ded5ce3529aede8ee5d82a94d934e4bc02d0edae 100644 (file)
@@ -502,7 +502,7 @@ EditorRouteGroups::button_press_event (GdkEventButton* ev)
  }
 
 void 
-EditorRouteGroups::row_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter)
+EditorRouteGroups::row_change (const Gtk::TreeModel::Path&const Gtk::TreeModel::iterator& iter)
 {
        RouteGroup* group;
 
@@ -666,6 +666,12 @@ EditorRouteGroups::connect_to_session (Session* s)
        groups_changed ();
 }
 
+struct CollectSorter {
+       bool operator () (Route* a, Route* b) {
+               return a->order_key (N_ ("editor")) < b->order_key (N_ ("editor"));
+       }
+};
+
 /** Collect all members of a RouteGroup so that they are together in the Editor.
  *  @param g Group to collect.
  */
@@ -673,6 +679,7 @@ void
 EditorRouteGroups::collect (RouteGroup* g)
 {
        list<Route*> routes = g->route_list ();
+       routes.sort (CollectSorter ());
        int const N = routes.size ();
 
        list<Route*>::iterator i = routes.begin ();
@@ -689,7 +696,7 @@ EditorRouteGroups::collect (RouteGroup* g)
                        int const k = r->order_key (N_ ("editor"));
                        
                        if (*i == r.get()) {
-                               
+
                                if (coll == -1) {
                                        coll = k;
                                        diff = N - 1;
@@ -712,5 +719,5 @@ EditorRouteGroups::collect (RouteGroup* g)
                ++j;
        }
 
-       _editor->_routes->sync_order_keys (N_ ("editor"));
+       _editor->_routes->sync_order_keys ("");
 }