Changeset 13128


Ignore:
Timestamp:
Jan 4, 2012, 12:06:30 AM (9 years ago)
Author:
livings124
Message:

update moveGroupAtRow:toRow to use NSMutableArrayAdditions's moveObjectAtIndex:toIndex:

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/GroupsController.m

    r11617 r13128  
    2424
    2525#import "GroupsController.h"
     26#import "NSMutableArrayAdditions.h"
    2627
    2728#define ICON_WIDTH 16.0
     
    282283- (void) moveGroupAtRow: (NSInteger) oldRow toRow: (NSInteger) newRow
    283284{
    284     if (oldRow < newRow)
    285         newRow--;
    286    
    287     //remove objects to reinsert
    288     id movingGroup = [[fGroups objectAtIndex: oldRow] retain];
    289     [fGroups removeObjectAtIndex: oldRow];
    290    
    291     //insert objects at new location
    292     [fGroups insertObject: movingGroup atIndex: newRow];
    293    
    294     [movingGroup release];
     285    [fGroups moveObjectAtIndex: oldRow toIndex: newRow];
    295286   
    296287    [self saveGroups];
  • trunk/macosx/GroupsPrefsController.m

    r13127 r13128  
    123123        NSInteger oldRow = [indexes firstIndex], selectedRow = [fTableView selectedRow];
    124124       
     125        if (oldRow < newRow)
     126            newRow--;
    125127       
    126128        if ([NSApp isOnLionOrBetter])
     
    128130       
    129131        [[GroupsController groups] moveGroupAtRow: oldRow toRow: newRow];
    130        
    131         if (oldRow < newRow)
    132             newRow--;
    133132       
    134133        if ([NSApp isOnLionOrBetter])
Note: See TracChangeset for help on using the changeset viewer.