Changeset 1381


Ignore:
Timestamp:
Jan 17, 2007, 6:54:43 AM (15 years ago)
Author:
livings124
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r1380 r1381  
    10691069    int count = [self fileCount], i;
    10701070    tr_file_t file;
    1071     NSMutableArray * files = [NSMutableArray array];
     1071    NSMutableArray * files = [NSMutableArray array], * pathComponents;
    10721072   
    10731073    for (i = 0; i < count; i++)
     
    10751075        file = fInfo->files[i];
    10761076       
    1077         [self insertPath: [[[NSString stringWithUTF8String: file.name] pathComponents] mutableCopy] withParent: files];
    10781077        /*[files addObject: [NSDictionary dictionaryWithObjectsAndKeys:
    10791078            [NSString stringWithUTF8String: file.name], @"Name",
    10801079            [NSNumber numberWithUnsignedLongLong: file.length], @"Size", nil]];*/
     1080       
     1081        pathComponents = [[[NSString stringWithUTF8String: file.name] pathComponents] mutableCopy];
     1082        if (fInfo->multifile)
     1083            [pathComponents removeObjectAtIndex: 0];
     1084       
     1085        [self insertPath: pathComponents withParent: files];
     1086        [pathComponents autorelease];
    10811087    }
    10821088    return files;
Note: See TracChangeset for help on using the changeset viewer.