use given control view

This commit is contained in:
Mitchell Livingston 2007-10-20 19:29:50 +00:00
parent 039eefb06e
commit b85c64d635
1 changed files with 3 additions and 4 deletions

View File

@ -66,15 +66,14 @@
- (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
{ {
Torrent * torrent = [(FileOutlineView *)[self controlView] torrent]; Torrent * torrent = [(FileOutlineView *)controlView torrent];
NSDictionary * dict = [self representedObject]; NSDictionary * dict = [self representedObject];
NSSet * priorities = [torrent filePrioritiesForIndexes: [dict objectForKey: @"Indexes"]]; NSSet * priorities = [torrent filePrioritiesForIndexes: [dict objectForKey: @"Indexes"]];
int count = [priorities count]; int count = [priorities count];
FileOutlineView * view = (FileOutlineView *)[self controlView]; int hoverRow = [(FileOutlineView *)controlView hoverRow];
int hoverRow = [view hoverRow]; if (count > 0 && hoverRow != -1 && [(FileOutlineView *)controlView itemAtRow: hoverRow] == dict)
if (count > 0 && hoverRow != -1 && [view itemAtRow: hoverRow] == dict)
{ {
[super setSelected: [priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]] forSegment: 0]; [super setSelected: [priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]] forSegment: 0];
[super setSelected: [priorities containsObject: [NSNumber numberWithInt: TR_PRI_NORMAL]] forSegment: 1]; [super setSelected: [priorities containsObject: [NSNumber numberWithInt: TR_PRI_NORMAL]] forSegment: 1];