From 02274a0e6025e0f50c7a0275432a82c8c15a6e2f Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Wed, 17 Jan 2007 06:54:43 +0000 Subject: [PATCH] if it is a multifile torrent don't show the base folder --- macosx/Torrent.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/macosx/Torrent.m b/macosx/Torrent.m index eb152cb6c..b1fb924e7 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -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; }