mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 17:50:19 +02:00
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:
parent
28bef814ed
commit
bde2979aa0
@ -3,15 +3,17 @@
|
|||||||
// Open a given URL with the default browser
|
// Open a given URL with the default browser
|
||||||
function OpenURL(AURL: String): Boolean;
|
function OpenURL(AURL: String): Boolean;
|
||||||
var
|
var
|
||||||
url: CFURLRef;
|
url: NSURL;
|
||||||
|
ws: NSWorkspace;
|
||||||
begin
|
begin
|
||||||
|
Result := False;
|
||||||
if AURL = '' then
|
if AURL = '' then
|
||||||
Exit(False);
|
Exit(False);
|
||||||
url := CFURLCreateWithBytes(nil, @AURL[1], Length(AURL), kCFStringEncodingUTF8, nil);
|
url := NSURL.URLWithString(NSStr(@AURL[1]));
|
||||||
if not Assigned(url) then
|
if not Assigned(url) then
|
||||||
Exit(False);
|
Exit(False);
|
||||||
Result := LSOpenCFURLRef(url, nil) = 0;
|
ws := NSWorkspace.sharedWorkspace;
|
||||||
CFRelease(url);
|
Result := ws.openURL(url);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Open a document with the default application associated with it in the system
|
// Open a document with the default application associated with it in the system
|
||||||
|
@ -40,12 +40,16 @@ unit LCLIntf;
|
|||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
{$inline on}
|
{$inline on}
|
||||||
|
|
||||||
|
{$IFDEF DARWIN}
|
||||||
|
{$modeswitch objectivec1}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF Windows}Windows, ShellApi,{$ENDIF}
|
{$IFDEF Windows}Windows, ShellApi,{$ENDIF}
|
||||||
{$IFDEF UNIX}Unix, {$ENDIF}
|
{$IFDEF UNIX}Unix, {$ENDIF}
|
||||||
{$IFDEF Darwin}MacOSAll, {$ENDIF}
|
{$IFDEF Darwin}MacOSAll, CocoaAll,{$ENDIF}
|
||||||
Types, Math, Classes, SysUtils, LCLType, LCLProc, GraphType, InterfaceBase,
|
Types, Math, Classes, SysUtils, LCLType, LCLProc, GraphType, InterfaceBase,
|
||||||
LResources, FileUtil, UTF8Process, Maps, LMessages, LazUTF8, lazutf8sysutils, LCLStrConsts;
|
LResources, FileUtil, UTF8Process, Maps, LMessages, LazUTF8, lazutf8sysutils, LCLStrConsts;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user