Changeset 154


Ignore:
Timestamp:
Mar 14, 2006, 11:50:04 PM (15 years ago)
Author:
titer
Message:

Fixes history with no torrents, always remove ellipis to menu items if
no torrent is selected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_api/macosx/Controller.m

    r153 r154  
    610610- (void) updateTorrentHistory
    611611{
    612     if( [fTorrents count] < 1 )
    613         return;
    614 
    615612    NSMutableArray * history = [NSMutableArray
    616613        arrayWithCapacity: [fTorrents count]];
     
    916913        || action == @selector(removeTorrentDeleteBoth:))
    917914    {
    918         if( !torrent )
    919             return NO;
    920 
    921915        //append or remove ellipsis when needed
    922         if( [torrent isActive] && [fDefaults boolForKey: @"CheckRemove"] )
     916        if( torrent && [torrent isActive] &&
     917            [fDefaults boolForKey: @"CheckRemove"] )
    923918        {
    924919            if (![[menuItem title] hasSuffix:NS_ELLIPSIS])
     
    930925                [menuItem setTitle:[[menuItem title] substringToIndex:[[menuItem title] length]-[NS_ELLIPSIS length]]];
    931926        }
    932         return YES;
     927        return ( torrent != nil );
    933928    }
    934929
     
    937932        action == @selector(stopTorrent:) )
    938933    {
    939         if( !torrent )
    940             return NO;
    941 
    942         if( [torrent isActive] )
     934        if( !torrent || [torrent isActive] )
    943935        {
    944936            [menuItem setTitle: @"Pause"];
     
    950942            [menuItem setAction: @selector( resumeTorrent: )];
    951943        }
     944        return ( torrent != nil );
    952945    }
    953946
Note: See TracChangeset for help on using the changeset viewer.