Changeset 3944
- Timestamp:
- Nov 23, 2007, 3:45:58 PM (14 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r3934 r3944 1145 1145 [torrent setWaitToStart: NO]; 1146 1146 1147 NSNumber * lowestOrderValue = nil, *currentOrderValue;1147 int lowestOrderValue = -1, currentOrderValue; 1148 1148 1149 1149 enumerator = [torrents objectEnumerator]; … … 1159 1159 //determine lowest order value 1160 1160 currentOrderValue = [torrent orderValue]; 1161 if ( !lowestOrderValue || [lowestOrderValue compare: currentOrderValue] == NSOrderedDescending)1161 if (lowestOrderValue < currentOrderValue) 1162 1162 lowestOrderValue = currentOrderValue; 1163 1163 … … 1169 1169 1170 1170 //reset the order values if necessary 1171 if ( [lowestOrderValue intValue]< [fTorrents count])1171 if (lowestOrderValue < [fTorrents count]) 1172 1172 { 1173 1173 NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: … … 1179 1179 1180 1180 int i; 1181 for (i = [lowestOrderValue intValue]; i < [tempTorrents count]; i++)1181 for (i = lowestOrderValue; i < [tempTorrents count]; i++) 1182 1182 [[tempTorrents objectAtIndex: i] setOrderValue: i]; 1183 1183 } … … 1603 1603 @"stateSortKey" ascending: !asc] autorelease], 1604 1604 * progressDescriptor = [[[NSSortDescriptor alloc] initWithKey: 1605 @"progress SortKey" ascending: !asc] autorelease],1605 @"progress" ascending: !asc] autorelease], 1606 1606 * ratioDescriptor = [[[NSSortDescriptor alloc] initWithKey: 1607 1607 @"ratioSortKey" ascending: !asc] autorelease]; … … 1613 1613 { 1614 1614 NSSortDescriptor * progressDescriptor = [[[NSSortDescriptor alloc] initWithKey: 1615 @"progress SortKey" ascending: asc] autorelease],1615 @"progress" ascending: asc] autorelease], 1616 1616 * ratioProgressDescriptor = [[[NSSortDescriptor alloc] initWithKey: 1617 1617 @"ratioProgressSortKey" ascending: asc] autorelease], … … 2190 2190 2191 2191 //reinsert into array 2192 int insertIndex = newRow > 0 ? [[ [fDisplayedTorrents objectAtIndex: newRow-1] orderValue] intValue] + 1 : 0;2192 int insertIndex = newRow > 0 ? [[fDisplayedTorrents objectAtIndex: newRow-1] orderValue] + 1 : 0; 2193 2193 2194 2194 //get all torrents to reorder -
trunk/macosx/Torrent.h
r3934 r3944 62 62 NSMenu * fFileMenu; 63 63 64 float 65 int 66 BOOL 67 68 NSNumber *fOrderValue;64 float fRatioLimit; 65 int fRatioSetting; 66 BOOL fFinishedSeeding, fWaitToStart, fError, fChecking, fStalled; 67 68 int fOrderValue; 69 69 70 70 NSDictionary * fQuickPauseDict; … … 202 202 - (void) setPex: (BOOL) enable; 203 203 204 - ( NSNumber *) orderValue;204 - (int) orderValue; 205 205 - (void) setOrderValue: (int) orderValue; 206 206 … … 230 230 231 231 - (NSNumber *) stateSortKey; 232 - (NSNumber *) progressSortKey;233 232 - (NSNumber *) ratioSortKey; 234 233 - (NSNumber *) ratioProgressSortKey; -
trunk/macosx/Torrent.m
r3934 r3944 126 126 [NSNumber numberWithFloat: fRatioLimit], @"RatioLimit", 127 127 [NSNumber numberWithBool: fWaitToStart], @"WaitToStart", 128 [ self orderValue], @"OrderValue", nil];128 [NSNumber numberWithInt: fOrderValue], @"OrderValue", nil]; 129 129 130 130 if (fIncompleteFolder) … … 162 162 [fFileList release]; 163 163 [fFileMenu release]; 164 165 [fOrderValue release];166 164 167 165 [fQuickPauseDict release]; … … 1152 1150 } 1153 1151 1154 - ( NSNumber *) orderValue1152 - (int) orderValue 1155 1153 { 1156 1154 return fOrderValue; … … 1159 1157 - (void) setOrderValue: (int) orderValue 1160 1158 { 1161 [fOrderValue release]; 1162 fOrderValue = [[NSNumber alloc] initWithInt: orderValue]; 1159 fOrderValue = orderValue; 1163 1160 } 1164 1161 … … 1365 1362 else 1366 1363 return [NSNumber numberWithInt: 2]; 1367 }1368 1369 - (NSNumber *) progressSortKey1370 {1371 return [NSNumber numberWithFloat: [self progress]];1372 1364 } 1373 1365
Note: See TracChangeset
for help on using the changeset viewer.