Changeset 6290


Ignore:
Timestamp:
Jul 7, 2008, 2:35:20 AM (13 years ago)
Author:
livings124
Message:

add a warning; improve the manual reordering code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r6289 r6290  
    20822082   
    20832083    [fTableView selectValues: selectedValues];
    2084     //removed because it made the inspector reset
     2084    #warning still happens anyway?
     2085    //removed because it made the inspector reset (noticeable when a transfer with web seeds is selected)
    20852086    //[self resetInfo]; //if group is already selected, but the torrents in it change
    20862087   
     
    27762777           
    27772778            //insert objects at new location
    2778             int insertIndex = topTorrent ? [fTorrents indexOfObject: topTorrent] + 1 : 0;
    2779             for (i = 0; i < [movingTorrents count]; i++)
    2780                 [fTorrents insertObject: [movingTorrents objectAtIndex: i] atIndex: insertIndex + i];
     2779            NSUInteger insertIndex = topTorrent ? [fTorrents indexOfObject: topTorrent] + 1 : 0;
     2780            NSIndexSet * insertIndexes = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(insertIndex, [movingTorrents count])];
     2781            [fTorrents insertObjects: movingTorrents atIndexes: insertIndexes];
    27812782           
    27822783            //redo order values
     
    27862787       
    27872788        [self applyFilter: nil];
    2788        
    2789         //set selected rows
    27902789        [fTableView selectValues: selectedValues];
    27912790    }
Note: See TracChangeset for help on using the changeset viewer.