Ignore:
Timestamp:
Jun 5, 2008, 2:46:39 AM (14 years ago)
Author:
livings124
Message:

some small simplifications to the group code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r6033 r6045  
    22662266    NSImage * icon;
    22672267    NSString * toolTip;
    2268     switch (groupIndex)
    2269     {
    2270         case GROUP_FILTER_ALL_TAG:
    2271             icon = [NSImage imageNamed: @"PinTemplate.png"];
    2272             toolTip = NSLocalizedString(@"All Groups", "Groups -> Button");
    2273             break;
    2274         case -1:
    2275             icon = [NSImage imageNamed: @"GroupsNoneTemplate.png"];
    2276             toolTip = [NSString stringWithFormat: @"%@: %@", NSLocalizedString(@"Group", "Groups -> Button"),
    2277                         NSLocalizedString(@"No Label", "Groups -> Button")];
    2278             break;
    2279         default:
    2280             icon = [[GroupsController groups] imageForIndex: groupIndex];
    2281             toolTip = [NSString stringWithFormat: @"%@: %@", NSLocalizedString(@"Group", "Groups -> Button"),
    2282                         [[GroupsController groups] nameForIndex: groupIndex]];
     2268    if (groupIndex == GROUP_FILTER_ALL_TAG)
     2269    {
     2270        icon = [NSImage imageNamed: @"PinTemplate.png"];
     2271        toolTip = NSLocalizedString(@"All Groups", "Groups -> Button");
     2272    }
     2273    else
     2274    {
     2275        icon = [[GroupsController groups] imageForIndex: groupIndex];
     2276        NSString * groupName = groupIndex != -1 ? [[GroupsController groups] nameForIndex: groupIndex]
     2277                                                : NSLocalizedString(@"None", "Groups -> Button");
     2278        toolTip = [NSString stringWithFormat: @"%@: %@", NSLocalizedString(@"Group", "Groups -> Button"), groupName];
    22832279    }
    22842280   
     
    25432539- (id) outlineView: (NSOutlineView *) outlineView objectValueForTableColumn: (NSTableColumn *) tableColumn byItem: (id) item
    25442540{
    2545     if (![item isKindOfClass: [Torrent class]])
     2541    if ([item isKindOfClass: [Torrent class]])
     2542        return [item hashString];
     2543    else
    25462544    {
    25472545        NSString * ident = [tableColumn identifier];
     
    25552553        {
    25562554            int group = [[item objectForKey: @"Group"] intValue];
    2557             return group != -1 ? [[GroupsController groups] imageForIndex: group]
    2558                                 : [NSImage imageNamed: @"GroupsNoneTemplate.png"];
     2555            return [[GroupsController groups] imageForIndex: group];
    25592556        }
    25602557        else if ([ident isEqualToString: @"DL Image"])
     
    25922589        }
    25932590    }
    2594     else
    2595         return [item hashString];
    25962591}
    25972592
Note: See TracChangeset for help on using the changeset viewer.