From c34d940361a27fc72ebb3f5c3804d8ff426b4824 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 28 Sep 2007 14:31:20 +0000 Subject: [PATCH] remove an unused dictionary --- macosx/Torrent.h | 2 +- macosx/Torrent.m | 39 +++++++++++++-------------------------- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/macosx/Torrent.h b/macosx/Torrent.h index 9b09f1c01..0ee750bb5 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -59,7 +59,7 @@ typedef enum NSImage * fIcon; tr_file_stat * fileStat; - NSArray * fFileList, * fFlatFileList; + NSArray * fFileList; NSMenu * fFileMenu; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 09004e2a2..bee213b8d 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -43,9 +43,8 @@ static int static_lastid = 0; - (void) updateDownloadFolder; - (void) createFileList; -- (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings - withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath - flatList: (NSMutableArray *) flatList fileSize: (uint64_t) size index: (int) index; +- (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings withParent: (NSMutableDictionary *) parent + previousPath: (NSString *) previousPath fileSize: (uint64_t) size index: (int) index; - (void) quickPause; - (void) endQuickPause; @@ -158,7 +157,6 @@ static int static_lastid = 0; [fIcon release]; [fFileList release]; - [fFlatFileList release]; [fFileMenu release]; @@ -967,7 +965,6 @@ static int static_lastid = 0; else string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"), [self peersGettingFromUs]]; - string = [string stringByAppendingFormat: @" - UL: %@", [NSString stringForSpeed: [self uploadRate]]]; break; @@ -1041,35 +1038,30 @@ static int static_lastid = 0; - (NSString *) remainingTimeString { - int eta, days; - - NSString * string; switch (fStat->status) { case TR_STATUS_CHECK_WAIT: - string = [NSLocalizedString(@"Waiting to check existing data", "Torrent -> status string") stringByAppendingEllipsis]; + return [NSLocalizedString(@"Waiting to check existing data", "Torrent -> status string") stringByAppendingEllipsis]; break; case TR_STATUS_CHECK: - string = [NSString stringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)", + return [NSString stringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)", "Torrent -> status string"), 100.0 * fStat->recheckProgress]; break; case TR_STATUS_DOWNLOAD: - string = [self eta] >= 0 ? [self etaString] : NSLocalizedString(@"Unknown", "Torrent -> remaining time"); + return [self eta] >= 0 ? [self etaString] : NSLocalizedString(@"Unknown", "Torrent -> remaining time"); break; case TR_STATUS_SEED: case TR_STATUS_DONE: - string = [NSLocalizedString(@"Ratio: ", "Torrent -> status string") stringByAppendingString: + return [NSLocalizedString(@"Ratio: ", "Torrent -> status string") stringByAppendingString: [NSString stringForRatio: [self ratio]]]; break; default: - string = @""; + return @""; } - - return string; } - (NSString *) stateString @@ -1554,7 +1546,7 @@ static int static_lastid = 0; NSMutableArray * pathComponents; NSString * path; - NSMutableArray * fileList = [[NSMutableArray alloc] init], + NSMutableArray * fileList = [[NSMutableArray alloc] initWithCapacity: count], * flatFileList = [[NSMutableArray alloc] initWithCapacity: count]; for (i = 0; i < count; i++) @@ -1570,20 +1562,17 @@ static int static_lastid = 0; else path = @""; - [self insertPath: pathComponents forSiblings: fileList withParent: nil previousPath: path - flatList: flatFileList fileSize: file->length index: i]; + [self insertPath: pathComponents forSiblings: fileList withParent: nil previousPath: path fileSize: file->length index: i]; [pathComponents autorelease]; } fFileList = [[NSArray alloc] initWithArray: fileList]; [fileList release]; - fFlatFileList = [[NSArray alloc] initWithArray: flatFileList]; [flatFileList release]; } -- (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings - withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath - flatList: (NSMutableArray *) flatList fileSize: (uint64_t) size index: (int) index +- (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings withParent: (NSMutableDictionary *) parent + previousPath: (NSString *) previousPath fileSize: (uint64_t) size index: (int) index { NSString * name = [components objectAtIndex: 0]; BOOL isFolder = [components count] > 1; @@ -1619,8 +1608,6 @@ static int static_lastid = 0; NSImage * icon = [[NSWorkspace sharedWorkspace] iconForFileType: [name pathExtension]]; [icon setFlipped: YES]; [dict setObject: icon forKey: @"Icon"]; - - [flatList addObject: dict]; } if (parent) @@ -1632,8 +1619,8 @@ static int static_lastid = 0; if (isFolder) { [components removeObjectAtIndex: 0]; - [self insertPath: components forSiblings: [dict objectForKey: @"Children"] - withParent: dict previousPath: currentPath flatList: flatList fileSize: size index: index]; + [self insertPath: components forSiblings: [dict objectForKey: @"Children"] withParent: dict + previousPath: currentPath fileSize: size index: index]; } }