Changeset 3218
- Timestamp:
- Sep 28, 2007, 2:31:20 PM (15 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Torrent.h
r3211 r3218 60 60 61 61 tr_file_stat * fileStat; 62 NSArray * fFileList , * fFlatFileList;62 NSArray * fFileList; 63 63 64 64 NSMenu * fFileMenu; -
trunk/macosx/Torrent.m
r3216 r3218 44 44 45 45 - (void) createFileList; 46 - (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings 47 withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath 48 flatList: (NSMutableArray *) flatList fileSize: (uint64_t) size index: (int) index; 46 - (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings withParent: (NSMutableDictionary *) parent 47 previousPath: (NSString *) previousPath fileSize: (uint64_t) size index: (int) index; 49 48 50 49 - (void) quickPause; … … 159 158 160 159 [fFileList release]; 161 [fFlatFileList release];162 160 163 161 [fFileMenu release]; … … 968 966 string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"), 969 967 [self peersGettingFromUs]]; 970 971 968 972 969 string = [string stringByAppendingFormat: @" - UL: %@", [NSString stringForSpeed: [self uploadRate]]]; … … 1042 1039 - (NSString *) remainingTimeString 1043 1040 { 1044 int eta, days;1045 1046 NSString * string;1047 1041 switch (fStat->status) 1048 1042 { 1049 1043 case TR_STATUS_CHECK_WAIT: 1050 string =[NSLocalizedString(@"Waiting to check existing data", "Torrent -> status string") stringByAppendingEllipsis];1044 return [NSLocalizedString(@"Waiting to check existing data", "Torrent -> status string") stringByAppendingEllipsis]; 1051 1045 break; 1052 1046 1053 1047 case TR_STATUS_CHECK: 1054 string =[NSString stringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)",1048 return [NSString stringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)", 1055 1049 "Torrent -> status string"), 100.0 * fStat->recheckProgress]; 1056 1050 break; 1057 1051 1058 1052 case TR_STATUS_DOWNLOAD: 1059 string =[self eta] >= 0 ? [self etaString] : NSLocalizedString(@"Unknown", "Torrent -> remaining time");1053 return [self eta] >= 0 ? [self etaString] : NSLocalizedString(@"Unknown", "Torrent -> remaining time"); 1060 1054 break; 1061 1055 1062 1056 case TR_STATUS_SEED: 1063 1057 case TR_STATUS_DONE: 1064 string =[NSLocalizedString(@"Ratio: ", "Torrent -> status string") stringByAppendingString:1058 return [NSLocalizedString(@"Ratio: ", "Torrent -> status string") stringByAppendingString: 1065 1059 [NSString stringForRatio: [self ratio]]]; 1066 1060 break; 1067 1061 1068 1062 default: 1069 string = @""; 1070 } 1071 1072 return string; 1063 return @""; 1064 } 1073 1065 } 1074 1066 … … 1555 1547 NSString * path; 1556 1548 1557 NSMutableArray * fileList = [[NSMutableArray alloc] init ],1549 NSMutableArray * fileList = [[NSMutableArray alloc] initWithCapacity: count], 1558 1550 * flatFileList = [[NSMutableArray alloc] initWithCapacity: count]; 1559 1551 … … 1571 1563 path = @""; 1572 1564 1573 [self insertPath: pathComponents forSiblings: fileList withParent: nil previousPath: path 1574 flatList: flatFileList fileSize: file->length index: i]; 1565 [self insertPath: pathComponents forSiblings: fileList withParent: nil previousPath: path fileSize: file->length index: i]; 1575 1566 [pathComponents autorelease]; 1576 1567 } … … 1578 1569 fFileList = [[NSArray alloc] initWithArray: fileList]; 1579 1570 [fileList release]; 1580 fFlatFileList = [[NSArray alloc] initWithArray: flatFileList];1581 1571 [flatFileList release]; 1582 1572 } 1583 1573 1584 - (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings 1585 withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath 1586 flatList: (NSMutableArray *) flatList fileSize: (uint64_t) size index: (int) index 1574 - (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings withParent: (NSMutableDictionary *) parent 1575 previousPath: (NSString *) previousPath fileSize: (uint64_t) size index: (int) index 1587 1576 { 1588 1577 NSString * name = [components objectAtIndex: 0]; … … 1620 1609 [icon setFlipped: YES]; 1621 1610 [dict setObject: icon forKey: @"Icon"]; 1622 1623 [flatList addObject: dict];1624 1611 } 1625 1612 … … 1633 1620 { 1634 1621 [components removeObjectAtIndex: 0]; 1635 [self insertPath: components forSiblings: [dict objectForKey: @"Children"] 1636 withParent: dict previousPath: currentPath flatList: flatListfileSize: size index: index];1622 [self insertPath: components forSiblings: [dict objectForKey: @"Children"] withParent: dict 1623 previousPath: currentPath fileSize: size index: index]; 1637 1624 } 1638 1625 }
Note: See TracChangeset
for help on using the changeset viewer.