Changeset 7521
- Timestamp:
- Dec 29, 2008, 2:39:41 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r7513 r7521 1807 1807 { 1808 1808 NSString * sortType = [fDefaults stringForKey: @"Sort"]; 1809 BOOL asc = ![fDefaults boolForKey: @"SortReverse"];1809 const BOOL asc = ![fDefaults boolForKey: @"SortReverse"]; 1810 1810 1811 1811 NSSortDescriptor * orderDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"orderValue" ascending: asc] autorelease]; … … 1886 1886 //get all the torrents in the table 1887 1887 NSMutableArray * previousTorrents; 1888 if ([fDisplayedTorrents count] > 0 && ![[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [Torrentclass]])1888 if ([fDisplayedTorrents count] > 0 && [[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]]) 1889 1889 { 1890 1890 previousTorrents = [NSMutableArray array]; … … 1919 1919 filterTracker = filterText && [[fDefaults stringForKey: @"FilterSearchType"] isEqualToString: FILTER_TYPE_TRACKER]; 1920 1920 1921 NSMutable IndexSet * indexes = [NSMutableIndexSet indexSet];1921 NSMutableArray * allTorrents = [NSMutableArray arrayWithCapacity: [fTorrents count]]; 1922 1922 1923 1923 //get count of each type 1924 NSInteger index = -1;1925 1924 for (Torrent * torrent in fTorrents) 1926 1925 { 1927 index++;1928 1929 1926 //check status 1930 1927 if ([torrent isActive] && ![torrent isCheckingWaiting]) … … 1988 1985 } 1989 1986 1990 [indexes addIndex: index]; 1991 } 1992 1993 NSArray * allTorrents = [fTorrents objectsAtIndexes: indexes]; 1987 [allTorrents addObject: torrent]; 1988 } 1994 1989 1995 1990 //set button tooltips … … 2016 2011 2017 2012 NSSortDescriptor * groupDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"groupOrderValue" ascending: YES] autorelease]; 2018 allTorrents = [allTorrents sortedArrayUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]];2013 [allTorrents sortUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]]; 2019 2014 2020 2015 NSMutableArray * groupTorrents;
Note: See TracChangeset
for help on using the changeset viewer.