+ 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();
+ }