simplify check for priority text

This commit is contained in:
Mitchell Livingston 2007-07-15 02:43:16 +00:00
parent 357f7444b0
commit f8fa5dc7a4
1 changed files with 7 additions and 6 deletions

View File

@ -54,7 +54,8 @@
Torrent * torrent = [(InfoWindowController *)[[[self controlView] window] windowController] selectedTorrent]; Torrent * torrent = [(InfoWindowController *)[[[self controlView] window] windowController] selectedTorrent];
NSSet * priorities = [torrent filePrioritiesForIndexes: [fItem objectForKey: @"Indexes"]]; NSSet * priorities = [torrent filePrioritiesForIndexes: [fItem objectForKey: @"Indexes"]];
if ([priorities count] == 0) int count = [priorities count];
if (count == 0)
return; return;
BOOL low = [priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]], BOOL low = [priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]],
@ -82,12 +83,12 @@
[NSFont messageFontOfSize: 18.0], NSFontAttributeName, nil]; [NSFont messageFontOfSize: 18.0], NSFontAttributeName, nil];
NSString * text; NSString * text;
if (low && !normal && !high) if (count > 1)
text = @"-";
else if (!low && !normal && high)
text = @"+";
else
text = @"*"; text = @"*";
else if (low)
text = @"-";
else
text = @"+";
NSSize textSize = [text sizeWithAttributes: attributes]; NSSize textSize = [text sizeWithAttributes: attributes];
NSRect textRect = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width - textSize.width) * 0.5, NSRect textRect = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width - textSize.width) * 0.5,