+
+ color_list->clear();
+
+ for (std::map<std::string,UIConfigVariable<uint32_t> *>::iterator i = ARDOUR_UI::config()->canvas_colors.begin(); i != ARDOUR_UI::config()->canvas_colors.end(); i++) {
+
+
+ UIConfigVariable<uint32_t>* var = i->second;
+
+ TreeModel::Children rows = color_list->children();
+ TreeModel::Row row;
+ string::size_type colon;
+
+ if ((colon = var->name().find (':')) != string::npos) {
+
+ /* this is supposed to be a child node, so find the
+ * parent
+ */
+
+ string parent = var->name().substr (0, colon);
+ TreeModel::iterator ri;
+
+ for (ri = rows.begin(); ri != rows.end(); ++ri) {
+ string s = (*ri)[columns.name];
+ if (s == parent) {
+ break;
+ }
+ }
+
+ if (ri == rows.end()) {
+ /* not found, add the parent as new top level row */
+ row = *(color_list->append());
+ row[columns.name] = parent;
+ row[columns.pVar] = 0;
+
+ /* now add the child as a child of this one */
+
+ row = *(color_list->insert (row->children().end()));
+ row[columns.name] = var->name().substr (colon+1);
+ } else {
+ row = *(color_list->insert ((*ri)->children().end()));
+ row[columns.name] = var->name().substr (colon+1);
+ }
+
+ } else {
+ /* add as a child */
+ row = *(color_list->append());
+ row[columns.name] = var->name();
+ }