| 187 | } |
| 188 | |
| 189 | void GuiFileTreeCtrl::addPathToTree( StringTableEntry path ) |
| 190 | { |
| 191 | if( !path ) |
| 192 | { |
| 193 | Con::errorf("GuiFileTreeCtrl::addPathToTree - Invalid Path!"); |
| 194 | return; |
| 195 | } |
| 196 | |
| 197 | // Identify which root (volume) this path belongs to (if any) |
| 198 | S32 root = getFirstRootItem(); |
| 199 | StringTableEntry ourPath = &path[ dStrcspn( path, "/" ) + 1]; |
| 200 | StringTableEntry ourRoot = StringUnit::getUnit( path, 0, "/" ); |
| 201 | // There are no current roots, we can safely create one |
| 202 | if( root == 0 ) |
| 203 | { |
| 204 | recurseInsert( NULL, path ); |
| 205 | } |
| 206 | else |
| 207 | { |
| 208 | while( root != 0 ) |
| 209 | { |
| 210 | if( dStricmp( getItemValue( root ), ourRoot ) == 0 ) |
| 211 | { |
| 212 | recurseInsert( getItem( root ), ourPath ); |
| 213 | break; |
| 214 | } |
| 215 | root = this->getNextSiblingItem( root ); |
| 216 | } |
| 217 | // We found none so we'll create one |
| 218 | if ( root == 0 ) |
| 219 | { |
| 220 | recurseInsert( NULL, path ); |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | void GuiFileTreeCtrl::onItemSelected( Item *item ) |
| 226 | { |
nothing calls this directly
no test coverage detected