1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

remove the cap on the number of messages in the message log - my tests had no problem with over 50,000 messages

This commit is contained in:
Mitchell Livingston 2009-11-22 03:56:04 +00:00
parent 00fc846037
commit 8f13af5040

View file

@ -32,7 +32,6 @@
#define LEVEL_DEBUG 2
#define UPDATE_SECONDS 0.6
#define MAX_MESSAGES 8000
@interface MessageWindowController (Private)
@ -170,24 +169,11 @@
tr_freeMessageList(messages);
NSUInteger total = [fMessages count];
if (total > MAX_MESSAGES)
{
//remove the oldest - move oldest to end for (assumedly) most efficient removal
NSSortDescriptor * descriptor = [[[NSSortDescriptor alloc] initWithKey: @"Index" ascending: NO] autorelease];
[fMessages sortUsingDescriptors: [NSArray arrayWithObject: descriptor]];
[fMessages removeObjectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(MAX_MESSAGES, total-MAX_MESSAGES)]];
[fMessageTable noteHeightOfRowsWithIndexesChanged: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, MAX_MESSAGES)]];
total = MAX_MESSAGES;
}
[fMessages sortUsingDescriptors: [fMessageTable sortDescriptors]];
[fMessageTable reloadData];
if (shouldScroll)
[fMessageTable scrollRowToVisible: total-1];
[fMessageTable scrollRowToVisible: [fMessages count]-1];
}
- (NSInteger) numberOfRowsInTableView: (NSTableView *) tableView