Changeset 9698


Ignore:
Timestamp:
Dec 10, 2009, 4:44:21 AM (12 years ago)
Author:
livings124
Message:

reset the message index when clearing the log

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.h

    r9618 r9698  
    3333   
    3434    NSMutableArray * fMessages, * fDisplayedMessages;
     35    NSUInteger fCurrentIndex;
    3536   
    3637    NSDictionary * fAttributes;
  • trunk/macosx/MessageWindowController.m

    r9680 r9698  
    154154        return;
    155155   
    156     static NSUInteger currentIndex = 0;
    157    
    158156    [fLock lock];
    159157   
    160158    NSScroller * scroller = [[fMessageTable enclosingScrollView] verticalScroller];
    161     const BOOL shouldScroll = currentIndex == 0 || [scroller floatValue] == 1.0 || [scroller isHidden]
     159    const BOOL shouldScroll = fCurrentIndex == 0 || [scroller floatValue] == 1.0 || [scroller isHidden]
    162160                                || [scroller knobProportion] == 1.0;
    163161   
     
    176174                                    [NSString stringWithUTF8String: currentMessage->message], @"Message",
    177175                                    [NSDate dateWithTimeIntervalSince1970: currentMessage->when], @"Date",
    178                                     [NSNumber numberWithUnsignedInteger: currentIndex++], @"Index", //more accurate when sorting by date
     176                                    [NSNumber numberWithUnsignedInteger: fCurrentIndex++], @"Index", //more accurate when sorting by date
    179177                                    [NSNumber numberWithInteger: currentMessage->level], @"Level",
    180178                                    name, @"Name",
     
    362360    [fDisplayedMessages removeAllObjects];
    363361    [fMessageTable reloadData];
     362    fCurrentIndex = 0;
    364363   
    365364    [fLock unlock];
  • trunk/macosx/NSStringAdditions.m

    r9527 r9698  
    154154}
    155155
    156 //also used in InfoWindow.xib
     156//also used in InfoWindow.xib and MessageWindow.xib
    157157- (NSComparisonResult) compareFinder: (NSString *) string
    158158{
Note: See TracChangeset for help on using the changeset viewer.