diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-06-16 23:01:05 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-06-16 23:11:47 +0300 |
commit | 7aa42913bb1828b877c2f73b4fe59cc3c65a67bf (patch) | |
tree | e2fa0f593bc279bcc4f72288d7870354c7d94c7a /fpicker/source | |
parent | 332bce15e713cc07836082e0d0e82efc6e671762 (diff) |
WaE: 'FSResolveAliasFile' is deprecated: first deprecated in OS X 10.8
Use the bookmark API instead.
Change-Id: I61fe91ea2c7287c52d45ddfee772ecfcfb5498b6
Diffstat (limited to 'fpicker/source')
-rw-r--r-- | fpicker/source/aqua/NSURL_OOoAdditions.mm | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm index c4567ebce99b..858eb27f04a4 100644 --- a/fpicker/source/aqua/NSURL_OOoAdditions.mm +++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm @@ -83,23 +83,25 @@ NSString* resolveAlias( NSString* i_pSystemPath ) kCFURLPOSIXPathStyle, false); if( rUrl != NULL ) { - FSRef rFS; - if( CFURLGetFSRef( rUrl, &rFS ) ) + CFErrorRef rError; + CFDataRef rBookmark = CFURLCreateBookmarkDataFromFile( NULL, rUrl, &rError ); + CFRelease( rUrl ); + if( rBookmark != NULL ) { - Boolean bIsFolder = false; - Boolean bAlias = false; - OSErr err = FSResolveAliasFile( &rFS, true, &bIsFolder, &bAlias); - if( (err == noErr) && bAlias ) + Boolean bIsStale; + CFURLRef rResolvedUrl = CFURLCreateByResolvingBookmarkData( kCFAllocatorDefault, rBookmark, kCFBookmarkResolutionWithoutUIMask, + NULL, NULL, &bIsStale, &rError ); + CFRelease( rBookmark ); + if( rResolvedUrl == NULL ) { - CFURLRef rResolvedUrl = CFURLCreateFromFSRef( kCFAllocatorDefault, &rFS ); - if( rResolvedUrl != NULL ) - { - pResolvedPath = (NSString*)CFURLCopyFileSystemPath( rResolvedUrl, kCFURLPOSIXPathStyle ); - CFRelease( rResolvedUrl ); - } + CFRelease( rError ); + } + else + { + pResolvedPath = (NSString*)CFURLCopyFileSystemPath( rResolvedUrl, kCFURLPOSIXPathStyle ); + CFRelease( rResolvedUrl ); } } - CFRelease( rUrl ); } return pResolvedPath; |