Ticket #130: skip_dir_and_name.diff

File skip_dir_and_name.diff, 1.0 kB (added by wazza, 6 months ago)
  • SapphireBrowser.m

    old new  
    426426        /*Check for dir*/ 
    427427        if(row < dirCount) 
    428428        { 
    429                 /*Browse the subdir*/ 
    430                 id controller = [[SapphireBrowser alloc] initWithScene:[self scene] metaData:[metaData metaDataForDirectory:name]]; 
     429                /*Browse the subdir, but skip over virtual directories with a single entry, iPod sty-lee*/ 
     430                SapphireDirectoryMetaData *subdirMeta = [metaData metaDataForDirectory:name]; 
     431                while( [[subdirMeta directories] count] == 1 ) 
     432                { 
     433                        [name release]; 
     434                        name = [[[subdirMeta directories] lastObject] retain]; 
     435                        subdirMeta = [subdirMeta metaDataForDirectory:name]; 
     436                } 
     437 
     438                id controller = [[SapphireBrowser alloc] initWithScene:[self scene] metaData:subdirMeta]; 
    431439                [controller setListTitle:[NSString stringWithFormat:@" %@",name]]; 
    432440                [controller setListIcon:[self listIcon]]; 
    433441                [[self stack] pushController:controller];