Changeset 3034


Ignore:
Timestamp:
Sep 10, 2007, 7:19:36 PM (14 years ago)
Author:
livings124
Message:

use a maximum number of messages

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r3033 r3034  
    3131
    3232#define UPDATE_SECONDS  0.6
    33 //#define MAX_LINES       2500
     33#define MAX_MESSAGES    2500
    3434
    3535@interface MessageWindowController (Private)
     
    131131        }*/
    132132       
    133         #warning remove old messages?
    134        
    135133        [fMessages addObject: [NSDictionary dictionaryWithObjectsAndKeys:
    136134                                [NSString stringWithUTF8String: currentMessage->message], @"Message",
     
    138136                                levelString, @"Level", nil]];
    139137    }
     138   
     139    #warning still needed?
     140    int total = [fMessages count];
     141    if (total > MAX_MESSAGES)
     142        [fMessages removeObjectsInRange: NSMakeRange(0, total-MAX_MESSAGES)];
    140143   
    141144    [fMessageView reloadData];
Note: See TracChangeset for help on using the changeset viewer.