mirror of
https://github.com/transmission/transmission
synced 2025-01-03 05:25:52 +00:00
another if-to-switch
This commit is contained in:
parent
3aa131a3e9
commit
039eefb06e
2 changed files with 21 additions and 18 deletions
|
@ -22,8 +22,8 @@
|
|||
* DEALINGS IN THE SOFTWARE.
|
||||
*****************************************************************************/
|
||||
|
||||
#import "FileOutlineView.h"
|
||||
#import "FileNameCell.h"
|
||||
#import "FileOutlineView.h"
|
||||
#import "Torrent.h"
|
||||
#import "NSStringAdditions.h"
|
||||
|
||||
|
|
|
@ -73,8 +73,8 @@
|
|||
int count = [priorities count];
|
||||
|
||||
FileOutlineView * view = (FileOutlineView *)[self controlView];
|
||||
int row = [view hoverRow];
|
||||
if (count > 0 && row != -1 && [view itemAtRow: row] == dict)
|
||||
int hoverRow = [view hoverRow];
|
||||
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_NORMAL]] forSegment: 1];
|
||||
|
@ -97,23 +97,26 @@
|
|||
fMixedImage = [NSImage imageNamed: @"PriorityMixed.png"];
|
||||
image = fMixedImage;
|
||||
}
|
||||
else if ([priorities containsObject: [NSNumber numberWithInt: TR_PRI_NORMAL]])
|
||||
else
|
||||
{
|
||||
switch ([[priorities anyObject] intValue])
|
||||
{
|
||||
case TR_PRI_NORMAL:
|
||||
if (!fNormalImage)
|
||||
fNormalImage = [NSImage imageNamed: @"PriorityNormal.png"];
|
||||
image = fNormalImage;
|
||||
}
|
||||
else if ([priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]])
|
||||
{
|
||||
break;
|
||||
case TR_PRI_LOW:
|
||||
if (!fLowImage)
|
||||
fLowImage = [NSImage imageNamed: @"PriorityLow.png"];
|
||||
image = fLowImage;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
case TR_PRI_HIGH:
|
||||
if (!fHighImage)
|
||||
fHighImage = [NSImage imageNamed: @"PriorityHigh.png"];
|
||||
image = fHighImage;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
NSSize imageSize = [image size];
|
||||
|
|
Loading…
Reference in a new issue