From 197e94910f58d6969ead06e8a429ecf36e73a650 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 20 Oct 2007 19:38:10 +0000 Subject: [PATCH] another switch --- macosx/FilePriorityCell.m | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/macosx/FilePriorityCell.m b/macosx/FilePriorityCell.m index 07e04350a..b09358626 100644 --- a/macosx/FilePriorityCell.m +++ b/macosx/FilePriorityCell.m @@ -52,16 +52,23 @@ //only for when clicking manually int priority; - if (segment == 0) - priority = TR_PRI_LOW; - else if (segment == 2) - priority = TR_PRI_HIGH; - else - priority = TR_PRI_NORMAL; + switch (segment) + { + case 0: + priority = TR_PRI_LOW; + break; + case 1: + priority = TR_PRI_NORMAL; + break; + case 2: + priority = TR_PRI_HIGH; + break; + } - Torrent * torrent = [(FileOutlineView *)[self controlView] torrent]; + FileOutlineView * controlView = (FileOutlineView *)[self controlView]; + Torrent * torrent = [controlView torrent]; [torrent setFilePriority: priority forIndexes: [[self representedObject] objectForKey: @"Indexes"]]; - [(FileOutlineView *)[self controlView] reloadData]; + [controlView reloadData]; } - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView