Use GoToURL since HOOKS is set up by this point.

This commit is contained in:
Steve Checkoway
2007-05-16 08:02:01 +00:00
parent 2b46dbc74a
commit 11262ae912
+3 -12
View File
@@ -1,6 +1,7 @@
#include "global.h" #include "global.h"
#include "Crash.h" #include "Crash.h"
#include "ProductInfo.h" #include "ProductInfo.h"
#include "arch/ArchHooks/ArchHooks.h"
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
@@ -19,16 +20,6 @@ RString CrashHandler::GetLogsDirectory()
return RString( dir ) + "/Logs/" PRODUCT_ID; return RString( dir ) + "/Logs/" PRODUCT_ID;
} }
// More or less copied from ArchHooks_darwin::GoToURL(), hmm.
static void OpenURL( const RString sURL )
{
CFURLRef url = CFURLCreateWithBytes( kCFAllocatorDefault, (const UInt8*)sURL.data(),
sURL.length(), kCFStringEncodingUTF8, NULL );
LSOpenCFURLRef( url, NULL );
CFRelease( url );
}
// XXX Can we use LocalizedString here instead? // XXX Can we use LocalizedString here instead?
#define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), NULL, CFSTR("Localizable") ) #define LSTRING(b,x) CFBundleCopyLocalizedString( (b), CFSTR(x), NULL, CFSTR("Localizable") )
@@ -58,11 +49,11 @@ void CrashHandler::InformUserOfCrash( const RString& sPath )
switch( response ) switch( response )
{ {
case kCFUserNotificationDefaultResponse: case kCFUserNotificationDefaultResponse:
OpenURL( REPORT_BUG_URL ); HOOKS->GoToURL( REPORT_BUG_URL );
// Fall through. // Fall through.
case kCFUserNotificationOtherResponse: case kCFUserNotificationOtherResponse:
// Open the file with the default application (probably TextEdit). // Open the file with the default application (probably TextEdit).
OpenURL( "file://" + sPath ); HOOKS->GoToURL( "file://" + sPath );
break; break;
} }
CFRelease( sBody ); CFRelease( sBody );