]> git.saurik.com Git - wxWidgets.git/commitdiff
cleaning up common OSX code
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 7 Mar 2008 19:38:01 +0000 (19:38 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 7 Mar 2008 19:38:01 +0000 (19:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/utilscmn.cpp

index c3b7898538ff7c11a7f5685f1c1787e4d1932e14..dd052b5c907167f076bca61c6ec9548e6134304e 100644 (file)
@@ -1055,29 +1055,17 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags)
     // because the code must use Objective-C features.
     return wxCocoaLaunchDefaultBrowser(url, flags);
 #elif defined(__WXMAC__)
-    OSStatus err;
-    ICInstance inst;
-    long int startSel;
-    long int endSel;
+    wxCFRef< CFURLRef > curl( CFURLCreateWithString( kCFAllocatorDefault,
+            wxCFStringRef( url ), NULL ) );
+    OSStatus err = LSOpenCFURLRef( curl , NULL );
 
-    err = ICStart(&inst, 'STKA'); // put your app creator code here
     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;
     }
     else
     {
-        wxLogDebug(wxT("ICStart error %d"), (int) err);
+        wxLogDebug(wxT("Browser Launch error %d"), (int) err);
         return false;
     }
 #else