From 6ec40d36769f42a31ff81279389c98ea3a4a666b Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 26 Sep 2012 14:34:02 +0000 Subject: Removed deprecation warning for FSCompareFSRefs(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9684 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 6d3defed7..d4a1c553d 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1331,20 +1331,12 @@ void fl_open_display() { if ( !GetCurrentProcess( &cur_psn ) && !GetFrontProcess( &front_psn ) && !SameProcess( &front_psn, &cur_psn, &same_psn ) && !same_psn ) { // only transform the application type for unbundled apps - CFBundleRef bundle = CFBundleGetMainBundle(); - if ( bundle ) { - FSRef execFs; - CFURLRef execUrl = CFBundleCopyExecutableURL( bundle ); - CFURLGetFSRef( execUrl, &execFs ); - - FSRef bundleFs; - GetProcessBundleLocation( &cur_psn, &bundleFs ); - - if ( !FSCompareFSRefs( &execFs, &bundleFs ) ) - bundle = NULL; - - CFRelease(execUrl); - } + NSBundle *bundle = [NSBundle mainBundle]; + if (bundle) { + NSString *exe = [bundle executablePath]; + NSString *bpath = [bundle bundlePath]; + if ([bpath isEqualToString:exe]) bundle = nil; + } if ( !bundle ) { -- cgit v1.2.3