Get rid of blank line at bottom of message log.

This commit is contained in:
Mitchell Livingston 2006-08-22 03:11:24 +00:00
parent 32cdb550fb
commit f548d17e8e
1 changed files with 6 additions and 1 deletions

View File

@ -86,6 +86,11 @@
NSCalendarDate * dateString;
for (currentMessage = messages; currentMessage != NULL; currentMessage = currentMessage->next)
{
//new line if text view is not empty
if (currentMessage != messages || ![[fTextView string] isEqualToString: @""])
[[fTextView textStorage] appendAttributedString: [[[NSAttributedString alloc]
initWithString: @"\n"] autorelease]];
int level = currentMessage->level;
if (level == TR_MSG_ERR)
levelString = @"ERR";
@ -98,7 +103,7 @@
dateString = [[NSDate dateWithTimeIntervalSince1970: currentMessage->when]
dateWithCalendarFormat: @"%Y-%m-%d %H:%M:%S" timeZone: nil];
messageString = [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%@ %@ %s\n",
messageString = [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%@ %@ %s",
dateString, levelString, currentMessage->message]] autorelease];
[[fTextView textStorage] appendAttributedString: messageString];