remove an unused dictionary

This commit is contained in:
Mitchell Livingston 2007-09-28 14:31:20 +00:00
parent c28a94d04c
commit c34d940361
2 changed files with 14 additions and 27 deletions

View File

@ -59,7 +59,7 @@ typedef enum
NSImage * fIcon; NSImage * fIcon;
tr_file_stat * fileStat; tr_file_stat * fileStat;
NSArray * fFileList, * fFlatFileList; NSArray * fFileList;
NSMenu * fFileMenu; NSMenu * fFileMenu;

View File

@ -43,9 +43,8 @@ static int static_lastid = 0;
- (void) updateDownloadFolder; - (void) updateDownloadFolder;
- (void) createFileList; - (void) createFileList;
- (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings - (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings withParent: (NSMutableDictionary *) parent
withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath previousPath: (NSString *) previousPath fileSize: (uint64_t) size index: (int) index;
flatList: (NSMutableArray *) flatList fileSize: (uint64_t) size index: (int) index;
- (void) quickPause; - (void) quickPause;
- (void) endQuickPause; - (void) endQuickPause;
@ -158,7 +157,6 @@ static int static_lastid = 0;
[fIcon release]; [fIcon release];
[fFileList release]; [fFileList release];
[fFlatFileList release];
[fFileMenu release]; [fFileMenu release];
@ -967,7 +965,6 @@ static int static_lastid = 0;
else else
string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"), string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"),
[self peersGettingFromUs]]; [self peersGettingFromUs]];
string = [string stringByAppendingFormat: @" - UL: %@", [NSString stringForSpeed: [self uploadRate]]]; string = [string stringByAppendingFormat: @" - UL: %@", [NSString stringForSpeed: [self uploadRate]]];
break; break;
@ -1041,35 +1038,30 @@ static int static_lastid = 0;
- (NSString *) remainingTimeString - (NSString *) remainingTimeString
{ {
int eta, days;
NSString * string;
switch (fStat->status) switch (fStat->status)
{ {
case TR_STATUS_CHECK_WAIT: 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; break;
case TR_STATUS_CHECK: 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]; "Torrent -> status string"), 100.0 * fStat->recheckProgress];
break; break;
case TR_STATUS_DOWNLOAD: 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; break;
case TR_STATUS_SEED: case TR_STATUS_SEED:
case TR_STATUS_DONE: case TR_STATUS_DONE:
string = [NSLocalizedString(@"Ratio: ", "Torrent -> status string") stringByAppendingString: return [NSLocalizedString(@"Ratio: ", "Torrent -> status string") stringByAppendingString:
[NSString stringForRatio: [self ratio]]]; [NSString stringForRatio: [self ratio]]];
break; break;
default: default:
string = @""; return @"";
} }
return string;
} }
- (NSString *) stateString - (NSString *) stateString
@ -1554,7 +1546,7 @@ static int static_lastid = 0;
NSMutableArray * pathComponents; NSMutableArray * pathComponents;
NSString * path; NSString * path;
NSMutableArray * fileList = [[NSMutableArray alloc] init], NSMutableArray * fileList = [[NSMutableArray alloc] initWithCapacity: count],
* flatFileList = [[NSMutableArray alloc] initWithCapacity: count]; * flatFileList = [[NSMutableArray alloc] initWithCapacity: count];
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
@ -1570,20 +1562,17 @@ static int static_lastid = 0;
else else
path = @""; path = @"";
[self insertPath: pathComponents forSiblings: fileList withParent: nil previousPath: path [self insertPath: pathComponents forSiblings: fileList withParent: nil previousPath: path fileSize: file->length index: i];
flatList: flatFileList fileSize: file->length index: i];
[pathComponents autorelease]; [pathComponents autorelease];
} }
fFileList = [[NSArray alloc] initWithArray: fileList]; fFileList = [[NSArray alloc] initWithArray: fileList];
[fileList release]; [fileList release];
fFlatFileList = [[NSArray alloc] initWithArray: flatFileList];
[flatFileList release]; [flatFileList release];
} }
- (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings - (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings withParent: (NSMutableDictionary *) parent
withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath previousPath: (NSString *) previousPath fileSize: (uint64_t) size index: (int) index
flatList: (NSMutableArray *) flatList fileSize: (uint64_t) size index: (int) index
{ {
NSString * name = [components objectAtIndex: 0]; NSString * name = [components objectAtIndex: 0];
BOOL isFolder = [components count] > 1; BOOL isFolder = [components count] > 1;
@ -1619,8 +1608,6 @@ static int static_lastid = 0;
NSImage * icon = [[NSWorkspace sharedWorkspace] iconForFileType: [name pathExtension]]; NSImage * icon = [[NSWorkspace sharedWorkspace] iconForFileType: [name pathExtension]];
[icon setFlipped: YES]; [icon setFlipped: YES];
[dict setObject: icon forKey: @"Icon"]; [dict setObject: icon forKey: @"Icon"];
[flatList addObject: dict];
} }
if (parent) if (parent)
@ -1632,8 +1619,8 @@ static int static_lastid = 0;
if (isFolder) if (isFolder)
{ {
[components removeObjectAtIndex: 0]; [components removeObjectAtIndex: 0];
[self insertPath: components forSiblings: [dict objectForKey: @"Children"] [self insertPath: components forSiblings: [dict objectForKey: @"Children"] withParent: dict
withParent: dict previousPath: currentPath flatList: flatList fileSize: size index: index]; previousPath: currentPath fileSize: size index: index];
} }
} }