Changeset 499
- Timestamp:
- Jul 1, 2006, 10:13:29 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r498 r499 1070 1070 return; 1071 1071 else; 1072 1073 //sort torrents by order value 1074 NSArray * sortedTorrents; 1075 if ([torrents count] > 1) 1076 { 1077 NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: 1078 @"orderValue" ascending: YES] autorelease]; 1079 NSArray * descriptors = [[NSArray alloc] initWithObjects: orderDescriptor, nil]; 1080 1081 sortedTorrents = [torrents sortedArrayUsingDescriptors: descriptors]; 1082 [descriptors release]; 1083 } 1084 else 1085 sortedTorrents = torrents; 1086 1072 1073 //determine the number of downloads needed to start 1087 1074 int desiredActive = [fDefaults integerForKey: @"WaitToStartNumber"]; 1088 1075 1076 NSEnumerator * enumerator = [fTorrents objectEnumerator]; 1089 1077 Torrent * torrent; 1090 NSEnumerator * enumerator = [fTorrents objectEnumerator];1091 1078 while ((torrent = [enumerator nextObject])) 1092 1079 if ([torrent isActive] && ![torrent isSeeding]) … … 1096 1083 break; 1097 1084 } 1085 1086 //sort torrents by order value 1087 NSArray * sortedTorrents; 1088 if ([torrents count] > 1 && desiredActive > 0) 1089 { 1090 NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: 1091 @"orderValue" ascending: YES] autorelease]; 1092 NSArray * descriptors = [[NSArray alloc] initWithObjects: orderDescriptor, nil]; 1093 1094 sortedTorrents = [torrents sortedArrayUsingDescriptors: descriptors]; 1095 [descriptors release]; 1096 } 1097 else 1098 sortedTorrents = torrents; 1098 1099 1099 1100 enumerator = [sortedTorrents objectEnumerator];
Note: See TracChangeset
for help on using the changeset viewer.