cleaning up common OSX code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1055,29 +1055,17 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags)
|
|||||||
// because the code must use Objective-C features.
|
// because the code must use Objective-C features.
|
||||||
return wxCocoaLaunchDefaultBrowser(url, flags);
|
return wxCocoaLaunchDefaultBrowser(url, flags);
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
OSStatus err;
|
wxCFRef< CFURLRef > curl( CFURLCreateWithString( kCFAllocatorDefault,
|
||||||
ICInstance inst;
|
wxCFStringRef( url ), NULL ) );
|
||||||
long int startSel;
|
OSStatus err = LSOpenCFURLRef( curl , NULL );
|
||||||
long int endSel;
|
|
||||||
|
|
||||||
err = ICStart(&inst, 'STKA'); // put your app creator code here
|
|
||||||
if (err == noErr)
|
if (err == noErr)
|
||||||
{
|
{
|
||||||
if (err == noErr)
|
|
||||||
{
|
|
||||||
ConstStr255Param hint = 0;
|
|
||||||
startSel = 0;
|
|
||||||
endSel = url.length();
|
|
||||||
err = ICLaunchURL(inst, hint, url.fn_str(), endSel, &startSel, &endSel);
|
|
||||||
if (err != noErr)
|
|
||||||
wxLogDebug(wxT("ICLaunchURL error %d"), (int) err);
|
|
||||||
}
|
|
||||||
ICStop(inst);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("ICStart error %d"), (int) err);
|
wxLogDebug(wxT("Browser Launch error %d"), (int) err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user