Changeset 9316


Ignore:
Timestamp:
Oct 17, 2009, 5:15:37 PM (12 years ago)
Author:
livings124
Message:

only remove a torrent from the queue for a local error, not tracker error; miscellaneous trivial adjustments

Location:
trunk/macosx
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BlocklistDownloaderViewController.m

    r7659 r9316  
    4848    [fButton setTitle: NSLocalizedString(@"Cancel", "Blocklist -> cancel button")];
    4949   
    50     CGFloat oldWidth = [fButton frame].size.width;
     50    const CGFloat oldWidth = [fButton frame].size.width;
    5151    [fButton sizeToFit];
    5252    NSRect buttonFrame = [fButton frame];
  • trunk/macosx/Controller.m

    r9314 r9316  
    894894        tr_ctor * ctor = tr_ctorNew(fLib);
    895895        tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]);
    896         int result = tr_torrentParse(ctor, &info);
     896        tr_parse_result result = tr_torrentParse(ctor, &info);
    897897        if (result != TR_PARSE_OK)
    898898        {
     
    904904                    [self invalidOpenAlert: [torrentPath lastPathComponent]];
    905905            }
    906             else //this shouldn't happen
    907                 NSLog(@"Unknown error code (%d) when attempting to open \"%@\"", result, torrentPath);
     906            else
     907                NSAssert2(NO, @"Unknown error code (%d) when attempting to open \"%@\"", result, torrentPath);
    908908           
    909909            tr_ctorFree(ctor);
     
    39843984    {
    39853985        if (!hasSeparator)
    3986             [fDockMenu insertItem: [NSMenuItem separatorItem] atIndex: seeding > 0 && downloading > 0 ? 2 : 1];
     3986            [fDockMenu insertItem: [NSMenuItem separatorItem] atIndex: (seeding > 0 && downloading > 0) ? 2 : 1];
    39873987    }
    39883988    else
  • trunk/macosx/StatsWindowController.m

    r9105 r9316  
    7373   
    7474    //size all elements
    75     CGFloat oldWidth = [fUploadedLabelField frame].size.width;
     75    const CGFloat oldWidth = [fUploadedLabelField frame].size.width;
    7676   
    7777    [fUploadedLabelField sizeToFit];
     
    112112   
    113113    //resize reset button
    114     CGFloat oldButtonWidth = [fResetButton frame].size.width;
     114    const CGFloat oldButtonWidth = [fResetButton frame].size.width;
    115115   
    116116    [fResetButton setTitle: NSLocalizedString(@"Reset", "Stats window -> reset button")];
  • trunk/macosx/Torrent.h

    r9297 r9316  
    162162- (BOOL) isComplete;
    163163- (BOOL) isError;
    164 - (BOOL) isErrorOrWarning;
     164- (BOOL) isAnyErrorOrWarning;
    165165- (NSString *) errorMessage;
    166166
  • trunk/macosx/Torrent.m

    r9309 r9316  
    852852- (BOOL) isError
    853853{
    854     return fStat->error == TR_STAT_LOCAL_ERROR || fStat->error == TR_STAT_TRACKER_ERROR;
    855 }
    856 
    857 - (BOOL) isErrorOrWarning
     854    return fStat->error == TR_STAT_LOCAL_ERROR;
     855}
     856
     857- (BOOL) isAnyErrorOrWarning
    858858{
    859859    return fStat->error != TR_STAT_OK;
     
    862862- (NSString *) errorMessage
    863863{
    864     if (![self isErrorOrWarning])
     864    if (![self isAnyErrorOrWarning])
    865865        return @"";
    866866   
     
    995995    NSString * string;
    996996   
    997     if ([self isErrorOrWarning])
     997    if ([self isAnyErrorOrWarning])
    998998    {
    999999        switch (fStat->error)
  • trunk/macosx/TorrentCell.m

    r9311 r9316  
    430430    }
    431431   
    432     const BOOL error = [torrent isErrorOrWarning];
     432    const BOOL error = [torrent isAnyErrorOrWarning];
    433433   
    434434    //icon
  • trunk/macosx/TorrentTableView.m

    r9298 r9316  
    140140- (NSCell *) outlineView: (NSOutlineView *) outlineView dataCellForTableColumn: (NSTableColumn *) tableColumn item: (id) item
    141141{
    142     BOOL group = ![item isKindOfClass: [Torrent class]];
     142    const BOOL group = ![item isKindOfClass: [Torrent class]];
    143143    if (!tableColumn)
    144144        return !group ? fTorrentCell : nil;
Note: See TracChangeset for help on using the changeset viewer.