From f8fa5dc7a4156df1eadbf6bd8f07cdf3aa050db8 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 15 Jul 2007 02:43:16 +0000 Subject: [PATCH] simplify check for priority text --- macosx/FilePriorityCell.m | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/macosx/FilePriorityCell.m b/macosx/FilePriorityCell.m index f3713ba13..95484358b 100644 --- a/macosx/FilePriorityCell.m +++ b/macosx/FilePriorityCell.m @@ -54,7 +54,8 @@ Torrent * torrent = [(InfoWindowController *)[[[self controlView] window] windowController] selectedTorrent]; NSSet * priorities = [torrent filePrioritiesForIndexes: [fItem objectForKey: @"Indexes"]]; - if ([priorities count] == 0) + int count = [priorities count]; + if (count == 0) return; BOOL low = [priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]], @@ -82,12 +83,12 @@ [NSFont messageFontOfSize: 18.0], NSFontAttributeName, nil]; NSString * text; - if (low && !normal && !high) - text = @"-"; - else if (!low && !normal && high) - text = @"+"; - else + if (count > 1) text = @"*"; + else if (low) + text = @"-"; + else + text = @"+"; NSSize textSize = [text sizeWithAttributes: attributes]; NSRect textRect = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width - textSize.width) * 0.5,