Changeset 13156


Ignore:
Timestamp:
Jan 12, 2012, 12:12:17 AM (10 years ago)
Author:
livings124
Message:

#4705 Removing a group in prefs doesn't remove the group row in the main window

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r13153 r13156  
    500500    [nc addObserver: self selector: @selector(openCreatedFile:)
    501501                    name: @"OpenCreatedTorrentFile" object: nil];
     502   
     503    [nc addObserver: self selector: @selector(applyFilter)
     504                    name: @"UpdateGroups" object: nil];
    502505
    503506    //timer to update the interface every second
     
    23532356       
    23542357        //remove empty groups
    2355         NSIndexSet * removeIndexes = [fDisplayedTorrents indexesOfObjectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, originalGroupCount)] options: NSEnumerationConcurrent passingTest: ^BOOL(id obj, NSUInteger idx, BOOL * stop) {
     2358        NSIndexSet * removeGroupIndexes = [fDisplayedTorrents indexesOfObjectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, originalGroupCount)] options: NSEnumerationConcurrent passingTest: ^BOOL(id obj, NSUInteger idx, BOOL * stop) {
    23562359            return [[(TorrentGroup *)obj torrents] count] == 0;
    23572360        }];
    23582361       
    2359         if ([removeIndexes count] > 0)
    2360         {
    2361             [fDisplayedTorrents removeObjectsAtIndexes: removeIndexes];
     2362        if ([removeGroupIndexes count] > 0)
     2363        {
     2364            [fDisplayedTorrents removeObjectsAtIndexes: removeGroupIndexes];
    23622365            if (onLion)
    2363                 [fTableView removeItemsAtIndexes: removeIndexes inParent: nil withAnimation: NSTableViewAnimationEffectFade];
     2366                [fTableView removeItemsAtIndexes: removeGroupIndexes inParent: nil withAnimation: NSTableViewAnimationEffectFade];
    23642367        }
    23652368       
     
    23702373    else
    23712374    {
    2372         NSAssert(groupRows != wasGroupRows, @"Trying togglng-group torrent reordering when we weren't expecting to.");
     2375        NSAssert(groupRows != wasGroupRows, @"Trying toggling group-torrent reordering when we weren't expecting to.");
    23732376       
    23742377        //since we're not doing this the right way (boo buggy animation), we need to remember selected values
  • trunk/macosx/FilterBarController.m

    r12897 r13156  
    393393{
    394394    [self updateGroupsButton];
    395    
    396     [[NSNotificationCenter defaultCenter] postNotificationName: @"ApplyFilter" object: nil];
    397395}
    398396
Note: See TracChangeset for help on using the changeset viewer.