if it is a multifile torrent don't show the base folder

This commit is contained in:
Mitchell Livingston 2007-01-17 06:54:43 +00:00
parent 091aec4abe
commit 02274a0e60
1 changed files with 8 additions and 2 deletions

View File

@ -1068,16 +1068,22 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
{
int count = [self fileCount], i;
tr_file_t file;
NSMutableArray * files = [NSMutableArray array];
NSMutableArray * files = [NSMutableArray array], * pathComponents;
for (i = 0; i < count; i++)
{
file = fInfo->files[i];
[self insertPath: [[[NSString stringWithUTF8String: file.name] pathComponents] mutableCopy] withParent: files];
/*[files addObject: [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithUTF8String: file.name], @"Name",
[NSNumber numberWithUnsignedLongLong: file.length], @"Size", nil]];*/
pathComponents = [[[NSString stringWithUTF8String: file.name] pathComponents] mutableCopy];
if (fInfo->multifile)
[pathComponents removeObjectAtIndex: 0];
[self insertPath: pathComponents withParent: files];
[pathComponents autorelease];
}
return files;
}