Changeset 8058


Ignore:
Timestamp:
Mar 14, 2009, 3:53:13 PM (13 years ago)
Author:
livings124
Message:

get the rpc password without using tr_sessionGetRPCPassword, in preparation for #1276

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PrefsController.h

    r7697 r8058  
    6161    NSMutableArray * fRPCWhitelistArray;
    6262    IBOutlet NSSegmentedControl * fRPCAddRemoveControl;
     63    NSString * fRPCPassword;
    6364}
    6465
  • trunk/macosx/PrefsController.m

    r7892 r8058  
    170170    [fRPCWhitelistArray release];
    171171   
     172    [fRPCPassword release];
     173   
    172174    [super dealloc];
    173175}
     
    248250    [fRPCPortField setIntValue: [fDefaults integerForKey: @"RPCPort"]];
    249251   
    250     //set rpc password - has to be released
    251     char * rpcPassword = tr_sessionGetRPCPassword(fHandle);
    252     [fRPCPasswordField setStringValue: [NSString stringWithUTF8String: rpcPassword]];
    253     tr_free(rpcPassword);
     252    //set rpc password
     253    if (fRPCPassword)
     254        [fRPCPasswordField setStringValue: fRPCPassword];
    254255}
    255256
     
    870871- (void) setRPCPassword: (id) sender
    871872{
     873    [fRPCPassword release];
     874    fRPCPassword = [[sender stringValue] copy];
     875   
    872876    const char * password = [[sender stringValue] UTF8String];
    873877    [self setKeychainPassword: password forService: RPC_KEYCHAIN_SERVICE username: RPC_KEYCHAIN_NAME];
     
    883887        strlen(RPC_KEYCHAIN_NAME), RPC_KEYCHAIN_NAME, &passwordLength, (void **)&password, NULL);
    884888   
     889    [fRPCPassword release];
    885890    if (password != NULL)
    886891    {
     
    891896       
    892897        tr_sessionSetRPCPassword(fHandle, fullPassword);
    893         [fRPCPasswordField setStringValue: [NSString stringWithUTF8String: fullPassword]];
    894     }
     898       
     899        fRPCPassword = [[NSString alloc] initWithUTF8String: fullPassword];
     900        [fRPCPasswordField setStringValue: fRPCPassword];
     901    }
     902    else
     903        fRPCPassword = nil;
    895904}
    896905
  • trunk/macosx/Torrent.m

    r8023 r8058  
    417417    const BOOL up = tr_torrentIsUsingGlobalSpeedLimit(fHandle, TR_UP);
    418418    const BOOL down = tr_torrentIsUsingGlobalSpeedLimit(fHandle, TR_DOWN);
    419     NSAssert(up == down, @"upload and download globallimit setting should have the same");
     419    NSAssert(up == down, @"upload and download global limit settings should have the same value");
    420420    return up;
    421421}
Note: See TracChangeset for help on using the changeset viewer.