Changeset 9577


Ignore:
Timestamp:
Nov 26, 2009, 2:11:00 AM (13 years ago)
Author:
livings124
Message:

some more tweaks for magnet links

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r9561 r9577  
    11311131    NSString * urlString = [fURLSheetTextField stringValue];
    11321132   
    1133     if ([urlString compare: @"magnet:" options: (NSAnchoredSearch | NSCaseInsensitiveSearch)])
     1133    if ([urlString rangeOfString: @"magnet:" options: (NSAnchoredSearch | NSCaseInsensitiveSearch)].location != NSNotFound)
    11341134        [self openMagnet: urlString];
    11351135    else
     
    11511151        }
    11521152       
    1153        
    1154         else
    1155         {
    1156             NSURL * url = [NSURL URLWithString: urlString];
    1157             [self performSelectorOnMainThread: @selector(openURL:) withObject: url waitUntilDone: NO];
    1158         }
     1153        NSURL * url = [NSURL URLWithString: urlString];
     1154        [self performSelectorOnMainThread: @selector(openURL:) withObject: url waitUntilDone: NO];
    11591155    }
    11601156}
  • trunk/macosx/Torrent.h

    r9566 r9577  
    4040    NSImage * fIcon;
    4141   
    42     NSString * fNameString, * fHashString;
     42    NSString * fHashString;
    4343   
    4444    tr_file_stat * fFileStat;
  • trunk/macosx/Torrent.m

    r9574 r9577  
    188188    [fPreviousFinishedIndexesDate release];
    189189   
    190     [fNameString release];
    191190    [fHashString release];
    192191   
     
    565564- (NSString *) name
    566565{
    567     return fNameString;
     566    return [NSString stringWithUTF8String: fInfo->name];
    568567}
    569568
     
    697696- (NSString *) torrentLocation
    698697{
    699     return [NSString stringWithUTF8String: fInfo->torrent];
     698    return fInfo->torrent ? [NSString stringWithUTF8String: fInfo->torrent] : @"";
    700699}
    701700
     
    15621561    tr_torrentSetRatioLimitHitCallback(fHandle, ratioLimitHitCallback, self);
    15631562   
    1564     fNameString = [[NSString alloc] initWithUTF8String: fInfo->name];
    15651563    fHashString = [[NSString alloc] initWithUTF8String: fInfo->hashString];
    15661564       
Note: See TracChangeset for help on using the changeset viewer.