Changeset 6001


Ignore:
Timestamp:
Jun 2, 2008, 6:47:54 PM (14 years ago)
Author:
livings124
Message:

merge some code for removing trackers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r6000 r6001  
    14531453    NSMutableIndexSet * indexes = [[[fTrackerTable selectedRowIndexes] mutableCopy] autorelease];
    14541454   
    1455     #warning merge?
    1456     //if a group is selected, remove all trackers in the group
    1457     NSUInteger i;
    1458     for (i = [indexes firstIndex]; i != NSNotFound; i = [indexes indexGreaterThanIndex: i])
    1459     {
    1460         if ([[fTrackers objectAtIndex: i] isKindOfClass: [NSNumber class]])
     1455   
     1456    NSUInteger i = 0;
     1457    while (i < [fTrackers count])
     1458    {
     1459        //if a group is selected, remove all trackers in the group
     1460        if ([indexes containsIndex: i])
    14611461        {
    14621462            for (i = i+1; i < [fTrackers count] && ![[fTrackers objectAtIndex: i] isKindOfClass: [NSNumber class]]; i++)
    14631463                [indexes addIndex: i];
    1464             i--;
    1465         }
    1466     }
    1467    
    1468     //remove empty groups
    1469     for (i = 0; i < [fTrackers count]; i++)
    1470         if (![indexes containsIndex: i] && [[fTrackers objectAtIndex: i] isKindOfClass: [NSNumber class]])
     1464        }
     1465        //remove empty groups
     1466        else
    14711467        {
    14721468            BOOL allSelected = YES;
     
    14821478                [indexes addIndex: i];
    14831479            i = j;
    1484         }
     1480           
     1481            //get to next group
     1482            while (i < [fTrackers count] && ![[fTrackers objectAtIndex: i] isKindOfClass: [NSNumber class]])
     1483                i++;
     1484        }
     1485    }
    14851486   
    14861487    if ([fTrackers count] == [indexes count])
Note: See TracChangeset for help on using the changeset viewer.