1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

use a maximum number of messages

This commit is contained in:
Mitchell Livingston 2007-09-10 19:19:36 +00:00
parent 830f65e9b5
commit 2e74340491
2 changed files with 6 additions and 3 deletions

View file

@ -30,7 +30,7 @@
#define LEVEL_DEBUG 2
#define UPDATE_SECONDS 0.6
//#define MAX_LINES 2500
#define MAX_MESSAGES 2500
@interface MessageWindowController (Private)
@ -130,14 +130,17 @@
[[fTextView textStorage] deleteCharactersInRange: NSMakeRange(0, loc + 1)];
}*/
#warning remove old messages?
[fMessages addObject: [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithUTF8String: currentMessage->message], @"Message",
[NSDate dateWithTimeIntervalSince1970: currentMessage->when], @"Date",
levelString, @"Level", nil]];
}
#warning still needed?
int total = [fMessages count];
if (total > MAX_MESSAGES)
[fMessages removeObjectsInRange: NSMakeRange(0, total-MAX_MESSAGES)];
[fMessageView reloadData];
tr_freeMessageList(messages);