Changeset 9892


Ignore:
Timestamp:
Jan 7, 2010, 1:52:15 AM (12 years ago)
Author:
livings124
Message:

change the code for determining which trackers to remove

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r9844 r9892  
    17451745   
    17461746    NSIndexSet * selectedIndexes = [fTrackerTable selectedRowIndexes];
    1747     for (NSUInteger i=0, trackerIndex = 0; i <= [selectedIndexes lastIndex]; ++i)
    1748     {
    1749         const BOOL isSelected = [selectedIndexes containsIndex: i];
    1750        
     1747    BOOL groupSelected = NO;
     1748    for (NSUInteger i = 0, trackerIndex = 0; i < [fTrackers count]; ++i)
     1749    {
    17511750        if ([[fTrackers objectAtIndex: i] isKindOfClass: [NSNumber class]])
    17521751        {
    1753             if (isSelected)
    1754             {
    1755                 for (++i; i < [fTrackers count] && ![[fTrackers objectAtIndex: i] isKindOfClass: [NSNumber class]]; ++i)
    1756                     [removeIndexes addIndex: trackerIndex++];
    1757                 --i;
    1758             }
     1752            groupSelected = [selectedIndexes containsIndex: i];
     1753            if (!groupSelected && i > [selectedIndexes lastIndex])
     1754                break;
    17591755        }
    17601756        else
    17611757        {
    1762             if (isSelected)
     1758            if (groupSelected || [selectedIndexes containsIndex: i])
    17631759                [removeIndexes addIndex: trackerIndex];
    17641760            ++trackerIndex;
Note: See TracChangeset for help on using the changeset viewer.