Commit f35551e5 authored by David Fuhrmann's avatar David Fuhrmann

macosx: simple prefs: robustify and cleanup saving int and string list

parent ddb643bf
...@@ -871,18 +871,20 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -871,18 +871,20 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
static inline void save_int_list(intf_thread_t * p_intf, id object, const char * name) static inline void save_int_list(intf_thread_t * p_intf, id object, const char * name)
{ {
NSNumber *p_valueobject; NSNumber *p_valueobject = (NSNumber *)[[object selectedItem] representedObject];
p_valueobject = (NSNumber *)[[object selectedItem] representedObject]; if (p_valueobject) {
assert([p_valueobject isKindOfClass:[NSNumber class]]); assert([p_valueobject isKindOfClass:[NSNumber class]]);
if (p_valueobject) config_PutInt(p_intf, name, [p_valueobject intValue]); config_PutInt(p_intf, name, [p_valueobject intValue]);
}
} }
static inline void save_string_list(intf_thread_t * p_intf, id object, const char * name) static inline void save_string_list(intf_thread_t * p_intf, id object, const char * name)
{ {
NSString *p_stringobject; NSString *p_stringobject = (NSString *)[[object selectedItem] representedObject];
p_stringobject = (NSString *)[[object selectedItem] representedObject]; if (p_stringobject) {
assert([p_stringobject isKindOfClass:[NSString class]]); assert([p_stringobject isKindOfClass:[NSString class]]);
config_PutPsz(p_intf, name, [p_stringobject UTF8String]); config_PutPsz(p_intf, name, [p_stringobject UTF8String]);
}
} }
- (void)saveChangedSettings - (void)saveChangedSettings
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment