Changeset 10236


Ignore:
Timestamp:
Feb 20, 2010, 2:29:33 PM (12 years ago)
Author:
livings124
Message:

when the message log is full, only reload if the content changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r10071 r10236  
    211211    if ([fMessages count] > TR_MAX_MSG_LOG)
    212212    {
     213        const NSUInteger oldCount = [fDisplayedMessages count];
     214       
    213215        NSIndexSet * removeIndexes = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fMessages count]-TR_MAX_MSG_LOG)];
    214216        NSArray * itemsToRemove = [fMessages objectsAtIndexes: removeIndexes];
     
    216218        [fMessages removeObjectsAtIndexes: removeIndexes];
    217219        [fDisplayedMessages removeObjectsInArray: itemsToRemove];
    218         changed = YES;
     220       
     221        changed |= oldCount > [fDisplayedMessages count];
    219222    }
    220223   
Note: See TracChangeset for help on using the changeset viewer.