if setting the proxy password to blank, delete it from the keychain

This commit is contained in:
Mitchell Livingston
2008-06-13 04:52:46 +00:00
parent 1c38bce649
commit 4c987b7a27
4 changed files with 21 additions and 4 deletions
+11 -3
View File
@@ -757,10 +757,18 @@
EMGenericKeychainItem * keychainItem = [[EMKeychainProxy sharedProxy] genericKeychainItemForService: @"Transmission:Proxy"
withUsername: @"Proxy"];
if (keychainItem)
[keychainItem setPassword: password];
{
if (![password isEqualToString: @""])
[keychainItem setPassword: password];
else
[keychainItem removeFromKeychain];
}
else
[[EMKeychainProxy sharedProxy] addGenericKeychainItemForService: @"Transmission:Proxy" withUsername: @"Proxy"
password: password];
{
if (![password isEqualToString: @""])
[[EMKeychainProxy sharedProxy] addGenericKeychainItemForService: @"Transmission:Proxy" withUsername: @"Proxy"
password: password];
}
tr_sessionSetProxyPassword(fHandle, [password UTF8String]);
}