From 624534f15e9353c4559c0c9b60605a2aa749de3d Mon Sep 17 00:00:00 2001 From: "smfr%smfr.org" Date: Tue, 13 Sep 2005 19:55:22 +0000 Subject: [PATCH] Fix bug 308356: fix saving keychain info by making sure we map return codes correctly. r=pinkerton --- camino/src/browser/KeychainService.mm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/camino/src/browser/KeychainService.mm b/camino/src/browser/KeychainService.mm index 288ba2e4452..492f9dd7c1a 100644 --- a/camino/src/browser/KeychainService.mm +++ b/camino/src/browser/KeychainService.mm @@ -391,9 +391,16 @@ int KeychainPrefChangedCallback(const char* inPref, void* unused) int result = [NSApp runModalForWindow:confirmStorePasswordPanel relativeToWindow:parent]; [confirmStorePasswordPanel close]; - // the results of hitButtonXX: map to the corresponding values in the - // |KeychainPromptResult| enum so we can just cast and return - return NS_STATIC_CAST(KeychainPromptResult, result); + KeychainPromptResult keychainAction = kDontRemember; + switch (result) + { + case NSAlertDefaultReturn: keychainAction = kSave; break; + default: + case NSAlertAlternateReturn: keychainAction = kDontRemember; break; + case NSAlertOtherReturn: keychainAction = kNeverRemember; break; + } + + return keychainAction; } //