diff options
| author | Alexandra Ellwood <lxs@mit.edu> | 2008-10-09 17:51:03 +0000 |
|---|---|---|
| committer | Alexandra Ellwood <lxs@mit.edu> | 2008-10-09 17:51:03 +0000 |
| commit | a963958bb2579862a367b6523a3f46d53109f8c8 (patch) | |
| tree | 993ffc9f6175c99fd467a0cbf95548cda16f4d91 /src/kim | |
| parent | 599a2fa44ec8d00eb632d6063220b43fb2455a52 (diff) | |
| download | krb5-a963958bb2579862a367b6523a3f46d53109f8c8.tar.gz krb5-a963958bb2579862a367b6523a3f46d53109f8c8.tar.xz krb5-a963958bb2579862a367b6523a3f46d53109f8c8.zip | |
preferences should handle KIM_OPTIONS_DEFAULT
ticket: new
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20854 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kim')
| -rw-r--r-- | src/kim/lib/kim_preferences.c | 2 | ||||
| -rw-r--r-- | src/kim/lib/kim_selection_hints.c | 6 | ||||
| -rw-r--r-- | src/kim/lib/mac/kim_os_preferences.c | 6 |
3 files changed, 5 insertions, 9 deletions
diff --git a/src/kim/lib/kim_preferences.c b/src/kim/lib/kim_preferences.c index 48dd75c63..d63a6141d 100644 --- a/src/kim/lib/kim_preferences.c +++ b/src/kim/lib/kim_preferences.c @@ -230,7 +230,7 @@ kim_error kim_favorites_add_identity (kim_favorites io_favorites, { kim_error err = KIM_NO_ERROR; kim_identity identity = NULL; - kim_options options = NULL; + kim_options options = KIM_OPTIONS_DEFAULT; kim_count insert_at = 0; if (!err && !io_favorites) { err = check_error (KIM_NULL_PARAMETER_ERR); } diff --git a/src/kim/lib/kim_selection_hints.c b/src/kim/lib/kim_selection_hints.c index 580191ded..797f70bd5 100644 --- a/src/kim/lib/kim_selection_hints.c +++ b/src/kim/lib/kim_selection_hints.c @@ -372,11 +372,7 @@ kim_error kim_selection_hints_get_options (kim_selection_hints in_selection_hin if (!err && !out_options ) { err = check_error (KIM_NULL_PARAMETER_ERR); } if (!err) { - if (in_selection_hints->options) { - err = kim_options_copy (out_options, in_selection_hints->options); - } else { - *out_options = KIM_OPTIONS_DEFAULT; - } + err = kim_options_copy (out_options, in_selection_hints->options); } return check_error (err); diff --git a/src/kim/lib/mac/kim_os_preferences.c b/src/kim/lib/mac/kim_os_preferences.c index 152132c04..0b48a7fbb 100644 --- a/src/kim/lib/mac/kim_os_preferences.c +++ b/src/kim/lib/mac/kim_os_preferences.c @@ -888,7 +888,7 @@ kim_error kim_os_preferences_set_options_for_key (kim_preference_key in_key, kim_error err = KIM_NO_ERROR; CFMutableDictionaryRef dictionary = NULL; - if (!err && !in_options) { err = check_error (KIM_NULL_PARAMETER_ERR); } + /* in_options may be KIM_OPTIONS_DEFAULT, in which case we empty the dict */ if (!err) { dictionary = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, @@ -897,7 +897,7 @@ kim_error kim_os_preferences_set_options_for_key (kim_preference_key in_key, if (!dictionary) { err = check_error (KIM_OUT_OF_MEMORY_ERR); } } - if (!err) { + if (!err && in_options) { err = kim_os_preferences_options_to_dictionary (in_options, dictionary); } @@ -937,7 +937,6 @@ kim_error kim_os_preferences_get_favorites_for_key (kim_preference_key in_key, for (i = 0; !err && i < count; i++) { CFDictionaryRef dictionary = NULL; - kim_options options = KIM_OPTIONS_DEFAULT; CFStringRef cfstring = NULL; dictionary = (CFDictionaryRef) CFArrayGetValueAtIndex (value, i); @@ -955,6 +954,7 @@ kim_error kim_os_preferences_get_favorites_for_key (kim_preference_key in_key, if (!err && cfstring) { kim_string string = NULL; kim_identity identity = NULL; + kim_options options = KIM_OPTIONS_DEFAULT; err = kim_os_string_create_from_cfstring (&string, cfstring); |
