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,40 +2650,30 @@ 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 for (i = newRow-1; i >= 0; i--)
{ {
#warning get working Torrent * tempTorrent = [groupTorrents objectAtIndex: i];
if (![movingTorrents containsObject: tempTorrent])
{
topTorrent = tempTorrent;
break;
}
}
#warning get working
//reset groups
/*if (item)
{
//change groups //change groups
/*int groupValue = [[item objectForKey: @"Group"] intValue]; int groupValue = [[item objectForKey: @"Group"] intValue];
NSEnumerator * enumerator = [movingTorrents objectEnumerator]; NSEnumerator * enumerator = [movingTorrents objectEnumerator];
Torrent * torrent; Torrent * torrent;
while ((torrent = [enumerator nextObject])) while ((torrent = [enumerator nextObject]))
[torrent setGroupValue: groupValue];*/ [torrent setGroupValue: groupValue];
}*/
NSArray * groupTorrents = [item objectForKey: @"Torrents"];
for (i = newRow-1; i >= 0; i--)
{
Torrent * tempTorrent = [groupTorrents objectAtIndex: i];
if (![movingTorrents containsObject: tempTorrent])
{
topTorrent = tempTorrent;
break;
}
}
}
else
{
for (i = newRow-1; i >= 0; i--)
{
Torrent * tempTorrent = [fDisplayedTorrents objectAtIndex: i];
if (![movingTorrents containsObject: tempTorrent])
{
topTorrent = tempTorrent;
break;
}
}
}
//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];