Carbon,Cocoa,QtCocoa: replaced outdated LSOpenCFURLRef.Now qtcocoa 64bit can be build w/o problems.Patch by Karl-Michael Schindler. issue #26890

git-svn-id: trunk@47654 -
This commit is contained in:
zeljko 2015-02-09 08:44:40 +00:00
parent 28bef814ed
commit bde2979aa0
2 changed files with 11 additions and 5 deletions

View File

@ -3,15 +3,17 @@
// Open a given URL with the default browser
function OpenURL(AURL: String): Boolean;
var
url: CFURLRef;
url: NSURL;
ws: NSWorkspace;
begin
Result := False;
if AURL = '' then
Exit(False);
url := CFURLCreateWithBytes(nil, @AURL[1], Length(AURL), kCFStringEncodingUTF8, nil);
url := NSURL.URLWithString(NSStr(@AURL[1]));
if not Assigned(url) then
Exit(False);
Result := LSOpenCFURLRef(url, nil) = 0;
CFRelease(url);
ws := NSWorkspace.sharedWorkspace;
Result := ws.openURL(url);
end;
// Open a document with the default application associated with it in the system

View File

@ -40,12 +40,16 @@ unit LCLIntf;
{$mode objfpc}{$H+}
{$inline on}
{$IFDEF DARWIN}
{$modeswitch objectivec1}
{$ENDIF}
interface
uses
{$IFDEF Windows}Windows, ShellApi,{$ENDIF}
{$IFDEF UNIX}Unix, {$ENDIF}
{$IFDEF Darwin}MacOSAll, {$ENDIF}
{$IFDEF Darwin}MacOSAll, CocoaAll,{$ENDIF}
Types, Math, Classes, SysUtils, LCLType, LCLProc, GraphType, InterfaceBase,
LResources, FileUtil, UTF8Process, Maps, LMessages, LazUTF8, lazutf8sysutils, LCLStrConsts;