Changeset 449
- Timestamp:
- Jun 23, 2006, 5:46:53 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r448 r449 1014 1014 { 1015 1015 if (![torrent isSeeding]) 1016 { 1016 1017 amountToStart--; 1018 if (amountToStart <= 0) 1019 break; 1020 } 1017 1021 } 1018 1022 else if ([torrent waitingToStart]) … … 1022 1026 1023 1027 int waitingCount = [waitingTorrents count]; 1024 if (amountToStart > waitingCount) 1025 amountToStart = waitingCount; 1026 1027 //sort torrents by date to start earliest added 1028 if (amountToStart > 0 && amountToStart < waitingCount) 1029 { 1030 NSSortDescriptor * dateDescriptor = [[[NSSortDescriptor alloc] initWithKey: 1031 @"date" ascending: YES] autorelease]; 1032 NSArray * descriptors = [[NSArray alloc] initWithObjects: dateDescriptor, nil]; 1028 1029 if (amountToStart > 0 && waitingCount > 0) 1030 { 1031 if (amountToStart > waitingCount) 1032 amountToStart = waitingCount; 1033 1033 1034 [waitingTorrents sortUsingDescriptors: descriptors]; 1035 [descriptors release]; 1036 } 1037 1038 int i; 1039 for (i = 0; i < amountToStart; i++) 1040 [[waitingTorrents objectAtIndex: i] startTransfer]; 1034 //sort torrents by date to start earliest added 1035 if (amountToStart < waitingCount) 1036 { 1037 NSSortDescriptor * dateDescriptor = [[[NSSortDescriptor alloc] initWithKey: 1038 @"date" ascending: YES] autorelease]; 1039 NSArray * descriptors = [[NSArray alloc] initWithObjects: dateDescriptor, nil]; 1040 1041 [waitingTorrents sortUsingDescriptors: descriptors]; 1042 [descriptors release]; 1043 } 1044 1045 int i; 1046 for (i = 0; i < amountToStart; i++) 1047 [[waitingTorrents objectAtIndex: i] startTransfer]; 1048 } 1041 1049 1042 1050 [waitingTorrents release];
Note: See TracChangeset
for help on using the changeset viewer.