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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.