Changeset 9543


Ignore:
Timestamp:
Nov 22, 2009, 3:56:04 AM (12 years ago)
Author:
livings124
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r9542 r9543  
    3333
    3434#define UPDATE_SECONDS  0.6
    35 #define MAX_MESSAGES    8000
    3635
    3736@interface MessageWindowController (Private)
     
    171170    tr_freeMessageList(messages);
    172171   
    173     NSUInteger total = [fMessages count];
    174     if (total > MAX_MESSAGES)
    175     {
    176         //remove the oldest - move oldest to end for (assumedly) most efficient removal
    177         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    
    186172    [fMessages sortUsingDescriptors: [fMessageTable sortDescriptors]];
    187173   
    188174    [fMessageTable reloadData];
    189175    if (shouldScroll)
    190         [fMessageTable scrollRowToVisible: total-1];
     176        [fMessageTable scrollRowToVisible: [fMessages count]-1];
    191177}
    192178
Note: See TracChangeset for help on using the changeset viewer.