Convert URLs to file paths. If the key already exists, overwrite it.

This commit is contained in:
Steve Checkoway
2006-05-26 23:41:42 +00:00
parent f40015aad9
commit f0f4433bf3
@@ -85,7 +85,7 @@ ArchHooks_darwin::ArchHooks_darwin()
CFStringRef appID = CFBundleGetIdentifier( bundle );
CFStringRef version = CFStringRef( CFBundleGetValueForInfoDictionaryKey(bundle, kCFBundleVersionKey) );
CFURLRef path = CFBundleCopyBundleURL( bundle );
CFPropertyListRef value = CFURLCopyPath( path );
CFPropertyListRef value = CFURLCopyFileSystemPath( path, kCFURLPOSIXPathStyle );
CFPropertyListRef old = CFPreferencesCopyAppValue( key, appID );
CFMutableDictionaryRef newDict = NULL;
@@ -110,7 +110,7 @@ ArchHooks_darwin::ArchHooks_darwin()
{
// The value is either not present or it is but it is different
newDict = CFDictionaryCreateMutableCopy( kCFAllocatorDefault, 0, dict );
CFDictionaryAddValue( newDict, version, value );
CFDictionarySetValue( newDict, version, value );
}
CFRelease( old );
}