Changeset 4935
- Timestamp:
- Feb 7, 2008, 1:26:12 AM (14 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r4930 r4935 1913 1913 1914 1914 NSMutableArray * groups = [NSMutableArray array], * groupTorrents; 1915 int i,oldGroupValue = -2;1915 int oldGroupValue = -2; 1916 1916 for (i = 0; i < [fDisplayedTorrents count]; i++) 1917 1917 { … … 1937 1937 [self sortTorrentsIgnoreSelected]; 1938 1938 [fTableView selectValues: selectedValues]; 1939 1940 //reset expanded/collapsed rows 1941 if (groupRows && [fDisplayedTorrents count] > 0 && [NSApp isOnLeopardOrBetter]) 1942 { 1943 NSIndexSet * collapsed = [fTableView collapsedGroupsIndexes]; 1944 enumerator = [fDisplayedTorrents objectEnumerator]; 1945 NSDictionary * dict; 1946 while ((dict = [enumerator nextObject])) 1947 { 1948 int value = [[dict objectForKey: @"Group"] intValue]; 1949 if ([collapsed containsIndex: value >= 0 ? value : INT_MAX]) 1950 [fTableView collapseItem: dict]; 1951 else 1952 [fTableView expandItem: dict]; 1953 } 1954 } 1939 1955 1940 1956 [self setBottomCountTextFiltering: groupRows || filterStatus || filterGroup || filterText]; -
trunk/macosx/TorrentTableView.h
r4930 r4935 34 34 { 35 35 IBOutlet Controller * fController; 36 NS IndexSet * fGroupIndexes;36 NSMutableIndexSet * fCollapsedGroups; 37 37 38 38 TorrentCell * fTorrentCell; … … 51 51 NSTimer * fPiecesBarTimer; 52 52 } 53 54 - (NSIndexSet *) collapsedGroupsIndexes; 53 55 54 56 - (void) removeButtonTrackingAreas; -
trunk/macosx/TorrentTableView.m
r4930 r4935 62 62 [[self tableColumnWithIdentifier: @"Torrent"] setDataCell: fTorrentCell]; 63 63 64 fCollapsedGroups = [[NSMutableIndexSet alloc] init]; 65 64 66 fMouseControlRow = -1; 65 67 fMouseRevealRow = -1; … … 77 79 - (void) dealloc 78 80 { 81 [fCollapsedGroups release]; 82 79 83 [fPiecesBarTimer invalidate]; 80 84 [fMenuTorrent release]; … … 85 89 86 90 [super dealloc]; 91 } 92 93 - (NSIndexSet *) collapsedGroupsIndexes 94 { 95 return fCollapsedGroups; 87 96 } 88 97 … … 248 257 - (void) outlineViewItemDidExpand: (NSNotification *) notification 249 258 { 259 int value = [[[[notification userInfo] objectForKey: @"NSObject"] objectForKey: @"Group"] intValue]; 260 [fCollapsedGroups removeIndex: value >= 0 ? value : INT_MAX]; 261 250 262 [[NSNotificationCenter defaultCenter] postNotificationName: @"OutlineExpandCollapse" object: self]; 251 263 } … … 253 265 - (void) outlineViewItemDidCollapse: (NSNotification *) notification 254 266 { 267 int value = [[[[notification userInfo] objectForKey: @"NSObject"] objectForKey: @"Group"] intValue]; 268 [fCollapsedGroups addIndex: value >= 0 ? value : INT_MAX]; 269 255 270 [[NSNotificationCenter defaultCenter] postNotificationName: @"OutlineExpandCollapse" object: self]; 256 271 } … … 323 338 id tableItem = [self itemAtRow: i]; 324 339 if (![tableItem isKindOfClass: [Torrent class]] && [[tableItem objectForKey: @"Group"] intValue] == group) 340 { 325 341 [indexSet addIndex: i]; 342 break; 343 } 326 344 } 327 345 }
Note: See TracChangeset
for help on using the changeset viewer.