Ignore:
Timestamp:
Jan 14, 2012, 8:07:26 PM (10 years ago)
Author:
livings124
Message:

unconditionally expand all groups when toggling group rows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r13163 r13164  
    18801880    BOOL sortByGroup = ![fDefaults boolForKey: @"SortByGroup"];
    18811881    [fDefaults setBool: sortByGroup forKey: @"SortByGroup"];
    1882    
    1883     //expand all groups
    1884     if (sortByGroup)
    1885         [fTableView removeAllCollapsedGroups];
    18861882   
    18871883    [self applyFilter];
     
    23752371        NSAssert(groupRows != wasGroupRows, @"Trying toggling group-torrent reordering when we weren't expecting to.");
    23762372       
     2373        //set all groups as expanded
     2374        [fTableView removeAllCollapsedGroups];
     2375       
    23772376        //since we're not doing this the right way (boo buggy animation), we need to remember selected values
    23782377        #warning when Lion-only and using views instead of cells, this likely won't be needed
     
    24052404            [fDisplayedTorrents setArray: [groupsByIndex allValues]];
    24062405           
     2406            //actually expand group rows
     2407            for (TorrentGroup * group in fDisplayedTorrents)
     2408                [fTableView expandItem: group];
     2409           
    24072410            //we need the groups to be sorted, and we can do it without moving items in the table, too!
    24082411            NSSortDescriptor * groupDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"groupOrderValue" ascending: YES];
     
    24142417        if (onLion)
    24152418            [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
    2416        
    2417         //reset expanded/collapsed rows
    2418         if (groupRows)
    2419         {
    2420             for (TorrentGroup * group in fDisplayedTorrents)
    2421             {
    2422                 if ([fTableView isGroupCollapsed: [group groupIndex]])
    2423                     [fTableView collapseItem: group];
    2424                 else
    2425                     [fTableView expandItem: group];
    2426             }
    2427         }
    24282419       
    24292420        if (selectedValues)
Note: See TracChangeset for help on using the changeset viewer.