From a396617f1adcbbb539e0d7efed4f81992b42b3b7 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 7 Jul 2008 02:35:20 +0000 Subject: [PATCH] add a warning; improve the manual reordering code --- macosx/Controller.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index c7b36c109..737b164b8 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -2081,7 +2081,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy } [fTableView selectValues: selectedValues]; - //removed because it made the inspector reset + #warning still happens anyway? + //removed because it made the inspector reset (noticeable when a transfer with web seeds is selected) //[self resetInfo]; //if group is already selected, but the torrents in it change [self setBottomCountText: groupRows || filterStatus || filterGroup || filterText]; @@ -2775,9 +2776,9 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy [fTorrents removeObjectsInArray: movingTorrents]; //insert objects at new location - int insertIndex = topTorrent ? [fTorrents indexOfObject: topTorrent] + 1 : 0; - for (i = 0; i < [movingTorrents count]; i++) - [fTorrents insertObject: [movingTorrents objectAtIndex: i] atIndex: insertIndex + i]; + NSUInteger insertIndex = topTorrent ? [fTorrents indexOfObject: topTorrent] + 1 : 0; + NSIndexSet * insertIndexes = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(insertIndex, [movingTorrents count])]; + [fTorrents insertObjects: movingTorrents atIndexes: insertIndexes]; //redo order values for (i = 0; i < [fTorrents count]; i++) @@ -2785,8 +2786,6 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy } [self applyFilter: nil]; - - //set selected rows [fTableView selectValues: selectedValues]; }