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:
parent
830f65e9b5
commit
2e74340491
2 changed files with 6 additions and 3 deletions
BIN
macosx/English.lproj/MessageWindow.nib/keyedobjects.nib
generated
BIN
macosx/English.lproj/MessageWindow.nib/keyedobjects.nib
generated
Binary file not shown.
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue