From 8f13af5040a15bced38a8c0bb0f5c277db0b593a Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 22 Nov 2009 03:56:04 +0000 Subject: [PATCH] remove the cap on the number of messages in the message log - my tests had no problem with over 50,000 messages --- macosx/MessageWindowController.m | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/macosx/MessageWindowController.m b/macosx/MessageWindowController.m index 2e8819d99..0f8063876 100644 --- a/macosx/MessageWindowController.m +++ b/macosx/MessageWindowController.m @@ -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