Changeset 9543
- Timestamp:
- Nov 22, 2009, 3:56:04 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/MessageWindowController.m
r9542 r9543 33 33 34 34 #define UPDATE_SECONDS 0.6 35 #define MAX_MESSAGES 800036 35 37 36 @interface MessageWindowController (Private) … … 171 170 tr_freeMessageList(messages); 172 171 173 NSUInteger total = [fMessages count];174 if (total > MAX_MESSAGES)175 {176 //remove the oldest - move oldest to end for (assumedly) most efficient removal177 NSSortDescriptor * descriptor = [[[NSSortDescriptor alloc] initWithKey: @"Index" ascending: NO] autorelease];178 [fMessages sortUsingDescriptors: [NSArray arrayWithObject: descriptor]];179 180 [fMessages removeObjectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(MAX_MESSAGES, total-MAX_MESSAGES)]];181 182 [fMessageTable noteHeightOfRowsWithIndexesChanged: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, MAX_MESSAGES)]];183 total = MAX_MESSAGES;184 }185 186 172 [fMessages sortUsingDescriptors: [fMessageTable sortDescriptors]]; 187 173 188 174 [fMessageTable reloadData]; 189 175 if (shouldScroll) 190 [fMessageTable scrollRowToVisible: total-1];176 [fMessageTable scrollRowToVisible: [fMessages count]-1]; 191 177 } 192 178
Note: See TracChangeset
for help on using the changeset viewer.