mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Use xdg-open to open files from flatpak sandbox (issue #309)
(cherry picked from commit 5712b87023)
This commit is contained in:
parent
91d0e7cb0b
commit
1adf973bd5
1 changed files with 13 additions and 16 deletions
|
|
@ -412,31 +412,28 @@ var
|
|||
begin
|
||||
Result:= False;
|
||||
|
||||
if FileIsUnixExecutable(URL) then
|
||||
if GetPathType(URL) = ptAbsolute then
|
||||
sCmdLine:= URL
|
||||
else begin
|
||||
sCmdLine:= IncludeTrailingPathDelimiter(mbGetCurrentDir);
|
||||
sCmdLine:= GetAbsoluteFileName(sCmdLine, URL)
|
||||
end;
|
||||
|
||||
if FileIsUnixExecutable(sCmdLine) then
|
||||
begin
|
||||
if GetPathType(URL) = ptAbsolute then
|
||||
sCmdLine:= URL
|
||||
else begin
|
||||
sCmdLine:= IncludeTrailingPathDelimiter(mbGetCurrentDir);
|
||||
sCmdLine:= GetAbsoluteFileName(sCmdLine, URL)
|
||||
end;
|
||||
Result:= ExecuteCommand(sCmdLine, [], mbGetCurrentDir);
|
||||
end
|
||||
else begin
|
||||
{$IF NOT DEFINED(HAIKU)}
|
||||
if (DesktopEnv = DE_KDE) and (HasKdeOpen = True) then
|
||||
Result:= KioOpen(URL) // Under KDE use "kioclient" to open files
|
||||
if (DesktopEnv = DE_FLATPAK) then
|
||||
Result:= ExecuteCommand('xdg-open', [sCmdLine], mbGetCurrentDir)
|
||||
else if (DesktopEnv = DE_KDE) and (HasKdeOpen = True) then
|
||||
Result:= KioOpen(sCmdLine) // Under KDE use "kioclient" to open files
|
||||
else if HasGio and (DesktopEnv <> DE_XFCE) then
|
||||
Result:= GioOpen(URL) // Under GNOME, Unity and LXDE use "GIO" to open files
|
||||
Result:= GioOpen(sCmdLine) // Under GNOME, Unity and LXDE use "GIO" to open files
|
||||
else
|
||||
{$ENDIF}
|
||||
begin
|
||||
if GetPathType(URL) = ptAbsolute then
|
||||
sCmdLine:= URL
|
||||
else begin
|
||||
sCmdLine:= IncludeTrailingPathDelimiter(mbGetCurrentDir);
|
||||
sCmdLine:= GetAbsoluteFileName(sCmdLine, URL)
|
||||
end;
|
||||
sCmdLine:= GetDefaultAppCmd(sCmdLine);
|
||||
if Length(sCmdLine) > 0 then begin
|
||||
Result:= ExecCmdFork(sCmdLine);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue