Changeset 5168

Show
Ignore:
Timestamp:
01/16/08 08:31:06 (6 months ago)
Author:
morris
Message:

Fix mixed up bookmarks when moving them around

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCPreferences.m

    r5042 r5168  
    16211621        NSArray                 *types; 
    16221622        NSInteger               fromRow; 
     1623        NSUInteger              index; 
    16231624         
    16241625        pasteboard = [info draggingPasteboard]; 
     
    16281629                fromRow = [[pasteboard stringForType:WCBookmarkPboardType] integerValue]; 
    16291630                dictionary = [[WCSettings objectForKey:WCBookmarks] mutableCopy]; 
    1630                 [dictionary moveObjectAtIndex:fromRow toIndex:row]; 
     1631                index = [dictionary moveObjectAtIndex:fromRow toIndex:row]; 
    16311632                [WCSettings setObject:dictionary forKey:WCBookmarks]; 
    16321633                [dictionary release]; 
    16331634                 
    1634                 [tableView selectRow:(row == (NSInteger) [dictionary count]) ? row - 1 : row byExtendingSelection:NO]; 
     1635                [tableView selectRow:index byExtendingSelection:NO]; 
    16351636 
    16361637                [[NSNotificationCenter defaultCenter] postNotificationName:WCBookmarksDidChange object:self]; 
     
    16591660                fromRow = [[pasteboard stringForType:WCTrackerBookmarkPboardType] integerValue]; 
    16601661                dictionary = [[WCSettings objectForKey:WCTrackerBookmarks] mutableCopy]; 
    1661                 [dictionary moveObjectAtIndex:fromRow toIndex:row]; 
     1662                index = [dictionary moveObjectAtIndex:fromRow toIndex:row]; 
    16621663                [WCSettings setObject:dictionary forKey:WCTrackerBookmarks]; 
    16631664                [dictionary release]; 
    1664                  
    1665                 [tableView selectRow:(row == (NSInteger) [dictionary count]) ? row - 1 : row byExtendingSelection:NO]; 
    1666                  
     1665 
     1666                [tableView selectRow:index byExtendingSelection:NO]; 
     1667 
    16671668                [[NSNotificationCenter defaultCenter] postNotificationName:WCTrackerBookmarksDidChange object:self]; 
    16681669