Changeset 9566


Ignore:
Timestamp:
Nov 25, 2009, 5:04:19 AM (13 years ago)
Author:
livings124
Message:

catch a couple of new cases when dealing with magnet transfers

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.h

    r9561 r9566  
    8787
    8888- (void) resetCache;
     89
     90- (BOOL) isMagnet;
    8991
    9092- (CGFloat) ratio;
  • trunk/macosx/Torrent.m

    r9561 r9566  
    337337}
    338338
     339- (BOOL) isMagnet
     340{
     341    return !tr_torrentHasMetadata(fHandle);
     342}
     343
    339344- (CGFloat) ratio
    340345{
     
    656661- (NSString *) comment
    657662{
    658     return [NSString stringWithUTF8String: fInfo->comment];
     663    return fInfo->comment ? [NSString stringWithUTF8String: fInfo->comment] : @"";
    659664}
    660665
    661666- (NSString *) creator
    662667{
    663     return [NSString stringWithUTF8String: fInfo->creator];
     668    return fInfo->creator ? [NSString stringWithUTF8String: fInfo->creator] : @"";
    664669}
    665670
     
    697702- (NSString *) dataLocation
    698703{
     704    if ([self isMagnet])
     705        return nil;
     706   
    699707    if ([self isFolder])
    700708    {
     
    756764- (CGFloat) progressLeft
    757765{
     766    if ([self size] == 0) //magnet links
     767        return 0.0;
     768   
    758769    return (CGFloat)[self sizeLeft] / [self size];
    759770}
Note: See TracChangeset for help on using the changeset viewer.