Adium

Changeset 24425

Show
Ignore:
Timestamp:
07/18/2008 01:53:28 PM (6 months ago)
Author:
evands
Message:

A drop just below a metacontact will appear to be in the group (and should be). In 10.4, however, this incorrectly targets the bottommost index of the metacontact. Adjust to fit reality accordingly. Fixes #10255, finally.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/AIListController.m

    r24109 r24425  
    592592                                                 [[outlineView dataSource] outlineView:outlineView numberOfChildrenOfItem:itemAboveProposedIndex] : 
    593593                                                 NSOutlineViewDropOnItemIndex); 
    594  
    595594                                [outlineView setDropItem:itemAboveProposedIndex 
    596595                                                  dropChildIndex:index]; 
     
    610609                                         * This should retarget to combine the dragged contact with the metacontact. 
    611610                                         */ 
    612                                         [outlineView setDropItem:[(AIListContact *)item parentContact] dropChildIndex:NSOutlineViewDropOnItemIndex]; 
     611                                        [outlineView setDropItem:[(AIListContact *)item parentContact] 
     612                                                          dropChildIndex:NSOutlineViewDropOnItemIndex]; 
    613613                                } 
    614614 
     
    635635                                         */ 
    636636                                        [outlineView setDropItem:item dropChildIndex:indexForInserting]; 
     637                                } else { 
     638                                        /* A drop just below a metacontact will appear to be in the group (and should be). 
     639                                         * Adjust to fit reality accordingly. 
     640                                         */ 
     641                                        if (item && [item isKindOfClass:[AIMetaContact class]]) { 
     642                                                BOOL isExpanded = [outlineView isItemExpanded:item]; 
     643                                                if ((isExpanded && (index == [[outlineView dataSource] outlineView:outlineView 
     644                                                                                                                                        numberOfChildrenOfItem:item])) || 
     645                                                        (!isExpanded && (index != NSOutlineViewDropOnItemIndex))) { 
     646                                                        [outlineView setDropItem:[item containingObject] 
     647                                                                          dropChildIndex:([[item containingObject] indexOfObject:item] + 1)]; 
     648                                                } 
     649                                        } 
    637650                                } 
    638651                        } 
     
    680693        NSPasteboard *draggingPasteboard = [info draggingPasteboard]; 
    681694        NSString        *availableType; 
    682          
     695 
    683696    if ((availableType = [draggingPasteboard availableTypeFromArray:[NSArray arrayWithObject:@"AIListObject"]])) { 
    684697                //Kill the selection now, (in a more finder-esque way)