Changeset 819 for trunk/macosx


Ignore:
Timestamp:
Aug 22, 2006, 2:56:09 AM (16 years ago)
Author:
livings124
Message:

Re-add time to message log.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r818 r819  
    7474- (void) updateLog: (NSTimer *) timer
    7575{
    76     tr_msg_list_t * messages = tr_getQueuedMessages(), * currentMessage;
    77     if (!messages)
     76    tr_msg_list_t * messages, * currentMessage;
     77    if (!(messages = tr_getQueuedMessages()))
    7878        return;
    7979   
     
    8484    NSAttributedString * messageString;
    8585    NSString * levelString;
     86    NSCalendarDate * dateString;
    8687    for (currentMessage = messages; currentMessage != NULL; currentMessage = currentMessage->next)
    8788    {
     
    9697            levelString = @"???";
    9798       
    98         messageString = [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%@ %s\n",
    99                                                             levelString, currentMessage->message]] autorelease];
     99        dateString = [[NSDate dateWithTimeIntervalSince1970: currentMessage->when]
     100                            dateWithCalendarFormat: @"%Y-%m-%d %H:%M:%S" timeZone: nil];
     101        messageString = [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%@ %@ %s\n",
     102                            dateString, levelString, currentMessage->message]] autorelease];
     103       
    100104        [[fTextView textStorage] appendAttributedString: messageString];
    101105    }
Note: See TracChangeset for help on using the changeset viewer.