Ignore:
Timestamp:
Dec 8, 2007, 7:59:44 PM (15 years ago)
Author:
livings124
Message:

update news and credits; put file name and line number in inspector tooltips

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r3923 r4096  
    114114        return;
    115115   
     116    NSMutableDictionary * message;
    116117    for (currentMessage = messages; currentMessage != NULL; currentMessage = currentMessage->next)
    117         [fMessages addObject: [NSDictionary dictionaryWithObjectsAndKeys:
    118                                 [NSString stringWithUTF8String: currentMessage->message], @"Message",
    119                                 [NSDate dateWithTimeIntervalSince1970: currentMessage->when], @"Date",
    120                                 [NSNumber numberWithInt: currentMessage->level], @"Level", nil]];
     118    {
     119        message  = [NSMutableDictionary dictionaryWithObjectsAndKeys:
     120                    [NSString stringWithUTF8String: currentMessage->message], @"Message",
     121                    [NSDate dateWithTimeIntervalSince1970: currentMessage->when], @"Date",
     122                    [NSNumber numberWithInt: currentMessage->level], @"Level", nil];
     123       
     124        if (currentMessage->file != NULL)
     125        {
     126            [message setObject: [NSString stringWithUTF8String: currentMessage->file] forKey: @"File"];
     127            [message setObject: [NSNumber numberWithInt: currentMessage->line] forKey: @"Line"];
     128        }
     129                               
     130        [fMessages addObject: message];
     131    }
    121132   
    122133    tr_freeMessageList(messages);
     
    320331    }
    321332   
    322     return [NSString stringWithFormat: @"%@ [%@] %@", [message objectForKey: @"Date"], level, [message objectForKey: @"Message"]];
     333    NSString * fileString, * file = [message objectForKey: @"File"];
     334    if ((file = [message objectForKey: @"File"]))
     335        fileString = [NSString stringWithFormat: @" %@:%d", [message objectForKey: @"File"],
     336                                        [[message objectForKey: @"Line"] intValue]];
     337    else
     338        fileString = @"";
     339   
     340    return [NSString stringWithFormat: @"%@%@ [%@] %@", [message objectForKey: @"Date"], fileString, level,
     341                                                            [message objectForKey: @"Message"]];
    323342}
    324343
Note: See TracChangeset for help on using the changeset viewer.