a little redundant code removal

This commit is contained in:
Mitchell Livingston 2008-05-12 01:49:48 +00:00
parent a1a3c43d19
commit b237f6089a
1 changed files with 18 additions and 28 deletions

View File

@ -2650,18 +2650,8 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
[movingTorrents addObject: [fTableView itemAtRow: i]]; [movingTorrents addObject: [fTableView itemAtRow: i]];
//find torrent to place under //find torrent to place under
NSArray * groupTorrents = item ? [item objectForKey: @"Torrents"] : fDisplayedTorrents;
Torrent * topTorrent = nil; Torrent * topTorrent = nil;
if (item) //sorting by group
{
#warning get working
//change groups
/*int groupValue = [[item objectForKey: @"Group"] intValue];
NSEnumerator * enumerator = [movingTorrents objectEnumerator];
Torrent * torrent;
while ((torrent = [enumerator nextObject]))
[torrent setGroupValue: groupValue];*/
NSArray * groupTorrents = [item objectForKey: @"Torrents"];
for (i = newRow-1; i >= 0; i--) for (i = newRow-1; i >= 0; i--)
{ {
Torrent * tempTorrent = [groupTorrents objectAtIndex: i]; Torrent * tempTorrent = [groupTorrents objectAtIndex: i];
@ -2671,19 +2661,19 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
break; break;
} }
} }
}
else #warning get working
//reset groups
/*if (item)
{ {
for (i = newRow-1; i >= 0; i--)
{ //change groups
Torrent * tempTorrent = [fDisplayedTorrents objectAtIndex: i]; int groupValue = [[item objectForKey: @"Group"] intValue];
if (![movingTorrents containsObject: tempTorrent]) NSEnumerator * enumerator = [movingTorrents objectEnumerator];
{ Torrent * torrent;
topTorrent = tempTorrent; while ((torrent = [enumerator nextObject]))
break; [torrent setGroupValue: groupValue];
} }*/
}
}
//get all torrents to reorder //get all torrents to reorder
NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"orderValue" ascending: YES] autorelease]; NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"orderValue" ascending: YES] autorelease];