mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-23 04:34:27 +00:00
Fixes 253929
Fixed a workaround for using registered user defaults on Tiger that I managed to break. Go me!
This commit is contained in:
1 parent
5684a1477e
commit
7228235ce3
1 file changed
+5
-5
@@ -121,13 +121,13 @@
|
||||
|
||||
- (id)objectForUserDefaultsKey:(NSString *)defaultName
|
||||
{
|
||||
CFPropertyListRef obj = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)[bundle bundleIdentifier]);
|
||||
// Under Tiger, CFPreferencesCopyAppValue doesn't get values from NSRegistratioDomain, so anything
|
||||
// passed into -[NSUserDefaults registerDefaults:] is ignored. The following line falls
|
||||
// back to using NSUserDefaults, but only if the host bundle is the main bundle, and no value
|
||||
// is found elsewhere.
|
||||
if (obj == NULL && bundle != [NSBundle mainBundle])
|
||||
obj = [[NSUserDefaults standardUserDefaults] objectForKey:defaultName];
|
||||
// back to using NSUserDefaults, but only if the host bundle is the main bundle.
|
||||
if (bundle == [NSBundle mainBundle])
|
||||
return [[NSUserDefaults standardUserDefaults] objectForKey:defaultName];
|
||||
|
||||
CFPropertyListRef obj = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)[bundle bundleIdentifier]);
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > 1050
|
||||
return [NSMakeCollectable(obj) autorelease];
|
||||
#else
|
||||
|
||||
Reference in new issue
Block a user