Changeset 13135
- Timestamp:
- Jan 7, 2012, 5:08:28 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r13134 r13135 2032 2032 - (void) applyFilter 2033 2033 { 2034 #warning re-add2035 //get all the torrents in the table2036 /*NSMutableArray * previousTorrents;2037 if ([fDisplayedTorrents count] > 0 && [[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]])2038 {2039 previousTorrents = [NSMutableArray array];2040 2041 for (TorrentGroup * group in fDisplayedTorrents)2042 [previousTorrents addObjectsFromArray: [group torrents]];2043 }2044 else2045 previousTorrents = fDisplayedTorrents;*/2046 2047 2034 const BOOL onLion = [NSApp isOnLionOrBetter]; 2048 2035 … … 2159 2146 [fFilterBar setCountAll: [fTorrents count] active: active downloading: downloading seeding: seeding paused: paused]; 2160 2147 2148 #warning could probably be merged with later code somehow 2161 2149 //clear display cache for not-shown torrents 2162 /*[previousTorrents removeObjectsInArray: allTorrents]; 2163 for (Torrent * torrent in previousTorrents) 2164 [torrent setPreviousFinishedPieces: nil];*/ 2150 if ([fDisplayedTorrents count] > 0) 2151 { 2152 NSMutableIndexSet * unusedIndexesInAll = [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [allTorrents count])]; 2153 2154 //for each torrent, removes the previous piece info if it's not in allTorrents, and keeps track of which torrents we already found in allTorrents 2155 void (^removePreviousFinishedPieces)(id, NSUInteger, BOOL *) = ^(id objDisplay, NSUInteger idx, BOOL * stop) { 2156 const NSUInteger index = [allTorrents indexOfObjectAtIndexes: unusedIndexesInAll options: NSEnumerationConcurrent passingTest: ^BOOL(id objAll, NSUInteger idxAll, BOOL * stopAll) { 2157 return objDisplay == objAll; 2158 }]; 2159 2160 if (index == NSNotFound) 2161 [(Torrent *)objDisplay setPreviousFinishedPieces: nil]; 2162 else 2163 [unusedIndexesInAll removeIndex: index]; 2164 }; 2165 2166 if ([[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]]) 2167 for (TorrentGroup * group in fDisplayedTorrents) 2168 [[group torrents] enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: removePreviousFinishedPieces]; 2169 else 2170 [fDisplayedTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: removePreviousFinishedPieces]; 2171 } 2165 2172 2166 2173 BOOL beganUpdates = NO;
Note: See TracChangeset
for help on using the changeset viewer.