Changeset 9296


Ignore:
Timestamp:
Oct 11, 2009, 4:42:39 PM (13 years ago)
Author:
livings124
Message:

make the message count a static variable

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.h

    r9294 r9296  
    3333   
    3434    NSMutableArray * fMessages;
    35     NSUInteger fIndex;
    3635   
    3736    NSDictionary * fAttributes;
  • trunk/macosx/MessageWindowController.m

    r9295 r9296  
    121121   
    122122    fMessages = [[NSMutableArray alloc] init];
    123     fIndex = 0;
    124123}
    125124
     
    140139- (void) updateLog: (NSTimer *) timer
    141140{
     141    static NSUInteger currentIndex = 0;
     142   
    142143    tr_msg_list * messages;
    143144    if ((messages = tr_getQueuedMessages()) == NULL)
     
    152153                                    [NSString stringWithUTF8String: currentMessage->message], @"Message",
    153154                                    [NSDate dateWithTimeIntervalSince1970: currentMessage->when], @"Date",
    154                                     [NSNumber numberWithUnsignedInteger: fIndex++], @"Index", //more accurate when sorting by date
     155                                    [NSNumber numberWithUnsignedInteger: currentIndex++], @"Index", //more accurate when sorting by date
    155156                                    [NSNumber numberWithInteger: currentMessage->level], @"Level",
    156157                                    name, @"Name",
     
    164165   
    165166    NSScroller * scroller = [[fMessageTable enclosingScrollView] verticalScroller];
    166     BOOL shouldScroll = [scroller floatValue] == 1.0 || [scroller isHidden] || [scroller knobProportion] == 1.0;
     167    const BOOL shouldScroll = [scroller floatValue] == 1.0 || [scroller isHidden] || [scroller knobProportion] == 1.0;
    167168   
    168169    NSUInteger total = [fMessages count];
Note: See TracChangeset for help on using the changeset viewer.