Changeset 5823 for trunk/macosx/Controller.m
- Timestamp:
- May 12, 2008, 9:38:24 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r5816 r5823 1991 1991 if (groupRows) 1992 1992 { 1993 [fDisplayedTorrents removeAllObjects]; 1994 1993 1995 NSSortDescriptor * groupDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"groupOrderValue" ascending: YES] autorelease]; 1994 1996 allTorrents = [allTorrents sortedArrayUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]]; 1995 1997 1996 NSMutableArray * group s = [NSMutableArray array], * groupTorrents;1998 NSMutableArray * groupTorrents; 1997 1999 int oldGroupValue = -2; 1998 2000 for (i = 0; i < [allTorrents count]; i++) … … 2005 2007 NSDictionary * dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt: groupValue], @"Group", 2006 2008 groupTorrents, @"Torrents", nil]; 2007 [ groups addObject: dict];2009 [fDisplayedTorrents addObject: dict]; 2008 2010 2009 2011 oldGroupValue = groupValue; … … 2012 2014 [groupTorrents addObject: torrent]; 2013 2015 } 2014 2015 [fDisplayedTorrents setArray: groups];2016 2016 } 2017 2017 else … … 2037 2037 2038 2038 [self setBottomCountText: groupRows || filterStatus || filterGroup || filterText]; 2039 2039 2040 2040 [self setWindowSizeToFit]; 2041 2041 } … … 2663 2663 } 2664 2664 2665 #warning get working2666 2665 //reset groups 2667 /*if (item) 2668 { 2669 2666 if (item) 2667 { 2670 2668 //change groups 2671 2669 int groupValue = [[item objectForKey: @"Group"] intValue]; … … 2673 2671 Torrent * torrent; 2674 2672 while ((torrent = [enumerator nextObject])) 2673 { 2674 //have to reset objects here to avoid weird crash 2675 [[[fTableView parentForItem: torrent] objectForKey: @"Torrent"] removeObject: torrent]; 2676 [[item objectForKey: @"Torrent"] addObject: torrent]; 2677 2675 2678 [torrent setGroupValue: groupValue]; 2676 }*/ 2679 } 2680 //part 1 of avoiding weird crash 2681 [fTableView reloadItem: nil reloadChildren: YES]; 2682 } 2683 2684 //remove objects to reinsert 2685 [fTorrents removeObjectsInArray: movingTorrents]; 2677 2686 2678 2687 //get all torrents to reorder 2679 2688 NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"orderValue" ascending: YES] autorelease]; 2680 2689 [fTorrents sortUsingDescriptors: [NSArray arrayWithObject: orderDescriptor]]; 2681 2682 //remove objects to reinsert2683 [fTorrents removeObjectsInArray: movingTorrents];2684 2690 2685 2691 //insert objects at new location
Note: See TracChangeset
for help on using the changeset viewer.