Skip to content

Commit 91b3710

Browse files
authored
Merge branch 'doublecmd:master' into master
2 parents 820a211 + 9084333 commit 91b3710

File tree

102 files changed

+7720
-6743
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+7720
-6743
lines changed

.github/scripts/create_release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ build_doublecmd()
5454
# Create *.dmg package
5555
HDI_TRY=1
5656

57-
while [ $HDI_TRY -le 3 ]; do
57+
while [ $HDI_TRY -le 5 ]; do
5858

5959
echo "Try to create a package $HDI_TRY ..."
6060

components/KASToolBar/kaspathedit.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function TKASPathEdit.isShowingListBox(): Boolean;
208208
end;
209209

210210
procedure TKASPathEdit.AutoComplete(const Path: String);
211-
{$IF LCL_FULLVERSION >= 2020000}
211+
{$IF LCL_FULLVERSION < 4990000}
212212
const
213213
AFlags: array[Boolean] of TMaskOptions = (
214214
[moDisableSets], [moDisableSets, moCaseSensitive]
@@ -236,7 +236,7 @@ procedure TKASPathEdit.AutoComplete(const Path: String);
236236
try
237237
// Check mask and make absolute file name
238238
AMask:= TMask.Create(ExtractFileName(Path) + '*',
239-
{$IF LCL_FULLVERSION >= 2020000}
239+
{$IF LCL_FULLVERSION < 4990000}
240240
AFlags[FileNameCaseSensitive]
241241
{$ELSE}
242242
FileNameCaseSensitive

components/doublecmd/dcdarwin.pas

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,73 @@
11
unit DCDarwin;
22

33
{$mode delphi}
4+
{$packrecords c}
5+
{$pointermath on}
46
{$modeswitch objectivec1}
57

68
interface
79

810
uses
9-
Classes, SysUtils, DCBasicTypes, CocoaAll;
11+
Classes, SysUtils, DCBasicTypes, CocoaAll, BaseUnix;
12+
13+
const
14+
CLOSE_RANGE_CLOEXEC = (1 << 2);
15+
16+
function CloseRange(first: cuint; last: cuint; flags: cint): cint; cdecl;
1017

1118
// MacOS File Utils
1219
function MacosFileSetCreationTime( const path:String; const birthtime:TFileTimeEx ): Boolean;
1320

1421
implementation
1522

23+
uses
24+
DCUnix;
25+
26+
type
27+
proc_fdinfo = record
28+
proc_fd: Int32;
29+
proc_fdtype: UInt32;
30+
end;
31+
Pproc_fdinfo = ^proc_fdinfo;
32+
33+
const
34+
PROC_PIDLISTFDS = 1;
35+
PROC_PIDLISTFD_SIZE = SizeOf(proc_fdinfo);
36+
37+
function proc_pidinfo(pid: cint; flavor: cint; arg: cuint64; buffer: pointer; buffersize: cint): cint; cdecl; external 'proc';
38+
39+
function CloseRange(first: cuint; last: cuint; flags: cint): cint; cdecl;
40+
var
41+
I: cint;
42+
Handle: cint;
43+
ProcessId: TPid;
44+
bufferSize: cint;
45+
pidInfo: Pproc_fdinfo;
46+
begin
47+
Result:= -1;
48+
ProcessId:= FpGetpid;
49+
bufferSize:= proc_pidinfo(ProcessId, PROC_PIDLISTFDS, 0, nil, 0);
50+
pidInfo:= GetMem(bufferSize);
51+
if Assigned(pidInfo) then
52+
begin
53+
bufferSize:= proc_pidinfo(ProcessId, PROC_PIDLISTFDS, 0, pidInfo, bufferSize);
54+
for I:= 0 to (bufferSize div PROC_PIDLISTFD_SIZE) - 1 do
55+
begin
56+
Handle:= pidInfo[I].proc_fd;
57+
if (Handle >= first) and (Handle <= last) then
58+
begin
59+
if (flags and CLOSE_RANGE_CLOEXEC <> 0) then
60+
FileCloseOnExec(Handle)
61+
else begin
62+
FileClose(Handle);
63+
end;
64+
end;
65+
end;
66+
Result:= 0;
67+
FreeMem(pidInfo);
68+
end;
69+
end;
70+
1671
function StringToNSString(const S: String): NSString;
1772
begin
1873
Result:= NSString(NSString.stringWithUTF8String(PAnsiChar(S)));

components/doublecmd/dclinux.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ interface
2929
uses
3030
Classes, SysUtils, BaseUnix, Unix;
3131

32+
const
33+
CLOSE_RANGE_CLOEXEC = (1 << 2);
34+
3235
const
3336
FS_IOC_GETFLAGS = $80086601;
3437
FS_IOC_SETFLAGS = $40086602;
@@ -75,7 +78,7 @@ function mbFileCopyXattr(const Source, Target: String): Boolean;
7578
implementation
7679

7780
uses
78-
InitC, DCUnix, DCConvertEncoding, DCOSUtils;
81+
InitC, DCConvertEncoding, DCOSUtils;
7982

8083
function lremovexattr(const path, name: PAnsiChar): cint; cdecl; external clib;
8184
function llistxattr(const path: PAnsiChar; list: PAnsiChar; size: csize_t): ssize_t; cdecl; external clib;

components/doublecmd/dcunix.pas

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ interface
4545
{$ELSEIF DEFINED(FREEBSD)}
4646
O_CLOEXEC = &04000000;
4747
_SC_NPROCESSORS_ONLN = 58;
48+
CLOSE_RANGE_CLOEXEC = (1 << 2);
4849
{$ELSEIF DEFINED(NETBSD)}
4950
O_CLOEXEC = $00400000;
5051
{$ELSEIF DEFINED(HAIKU)}
@@ -267,6 +268,9 @@ function fpMkTime(tm: PTimeStruct): TTime;
267268
function fpLocalTime(timer: PTime; tp: PTimeStruct): PTimeStruct;
268269

269270
{$IF DEFINED(LINUX)}
271+
var
272+
KernVersion: UInt16;
273+
270274
function fpFDataSync(fd: cint): cint;
271275
function fpCloneFile(src_fd, dst_fd: cint): Boolean;
272276
function fpFAllocate(fd: cint; mode: cint; offset, len: coff_t): cint;
@@ -280,8 +284,12 @@ implementation
280284

281285
uses
282286
Unix, DCConvertEncoding, LazUTF8
283-
{$IFDEF DARWIN}
287+
{$IF DEFINED(DARWIN)}
284288
, DCDarwin
289+
{$ELSEIF DEFINED(LINUX)}
290+
, Dos, DCLinux, DCOSUtils
291+
{$ELSEIF DEFINED(FREEBSD)}
292+
, DCOSUtils
285293
{$ENDIF}
286294
;
287295

@@ -387,8 +395,6 @@ function DC_FileSetTime(const FileName: String;
387395
{$ENDIF}
388396
end;
389397

390-
391-
392398
{$IF DEFINED(BSD)}
393399
type rlim_t = Int64;
394400
{$ENDIF}
@@ -416,6 +422,21 @@ function fdatasync(fd: cint): cint; cdecl; external clib;
416422
function fallocate(fd: cint; mode: cint; offset, len: coff_t): cint; cdecl; external clib;
417423
{$ENDIF}
418424

425+
{$IF DEFINED(LINUX) OR DEFINED(FREEBSD)}
426+
var
427+
hLibC: TLibHandle = NilHandle;
428+
429+
procedure LoadCLibrary;
430+
begin
431+
hLibC:= mbLoadLibrary(mbGetModuleName(@tzset));
432+
end;
433+
{$ENDIF}
434+
435+
{$IF DEFINED(LINUX) OR DEFINED(BSD)}
436+
var
437+
close_range: function(first: cuint; last: cuint; flags: cint): cint; cdecl = nil;
438+
{$ENDIF}
439+
419440
procedure FileCloseOnExecAll;
420441
const
421442
MAX_FD = 1024;
@@ -424,6 +445,13 @@ procedure FileCloseOnExecAll;
424445
p: TRLimit;
425446
fd_max: rlim_t = RLIM_INFINITY;
426447
begin
448+
{$IF DEFINED(LINUX) OR DEFINED(BSD)}
449+
if Assigned(close_range) then
450+
begin
451+
close_range(3, High(Int32), CLOSE_RANGE_CLOEXEC);
452+
Exit;
453+
end;
454+
{$ENDIF}
427455
if (FpGetRLimit(RLIMIT_NOFILE, @p) = 0) and (p.rlim_cur <> RLIM_INFINITY) then
428456
fd_max:= p.rlim_cur
429457
else begin
@@ -571,8 +599,26 @@ function fpFAllocate(fd: cint; mode: cint; offset, len: coff_t): cint;
571599
end;
572600
{$ENDIF}
573601

574-
initialization
602+
procedure Initialize;
603+
begin
575604
tzset();
605+
{$IF DEFINED(LINUX) OR DEFINED(FREEBSD)}
606+
LoadCLibrary;
607+
{$IF DEFINED(LINUX)}
608+
KernVersion:= BEtoN(DosVersion);
609+
// Linux kernel >= 5.11
610+
if KernVersion >= $50B then
611+
{$ENDIF}
612+
begin
613+
Pointer(close_range):= GetProcAddress(hLibC, 'close_range');
614+
end;
615+
{$ELSEIF DEFINED(DARWIN)}
616+
close_range:= @CloseRange;
617+
{$ENDIF}
618+
end;
619+
620+
initialization
621+
Initialize;
576622

577623
end.
578624

components/viewer/viewercontrol.pas

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,7 @@ TViewerControl = class(TCustomControl)
452452
function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override;
453453
function DoMouseWheelLeft(Shift: TShiftState; MousePos: TPoint): Boolean; override;
454454
function DoMouseWheelRight(Shift: TShiftState; MousePos: TPoint): Boolean; override;
455-
{$if lcl_fullversion >= 1070000}
456455
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy; const AXProportion, AYProportion: Double); override;
457-
{$endif}
458456

459457
public
460458
constructor Create(AOwner: TComponent); override;
@@ -556,6 +554,9 @@ implementation
556554
uses
557555
Math, LCLType, Graphics, Forms, LCLProc, Clipbrd, LConvEncoding,
558556
DCUnicodeUtils, LCLIntf, LazUTF8, DCOSUtils , DCConvertEncoding
557+
{$IF LCL_FULLVERSION >= 4990000}
558+
, LazUTF16
559+
{$ENDIF}
559560
{$IF DEFINED(UNIX)}
560561
, BaseUnix, Unix, DCUnix
561562
{$ELSEIF DEFINED(WINDOWS)}
@@ -2745,14 +2746,12 @@ function TViewerControl.DoMouseWheelRight(Shift: TShiftState; MousePos: TPoint):
27452746
Result := HScroll(Mouse.WheelScrollLines);
27462747
end;
27472748

2748-
{$if lcl_fullversion >= 1070000}
27492749
procedure TViewerControl.DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy; const AXProportion, AYProportion: Double);
27502750
begin
27512751
FScrollBarVert.Width := LCLIntf.GetSystemMetrics(SM_CYVSCROLL);
27522752
FScrollBarHorz.Height := LCLIntf.GetSystemMetrics(SM_CYHSCROLL);
27532753
inherited DoAutoAdjustLayout(AMode, AXProportion, AYProportion);
27542754
end;
2755-
{$endif}
27562755

27572756
function TViewerControl.XYPos2Adr(x, y: Integer; out CharSide: TCharSide): PtrInt;
27582757
var

language/doublecmd.be.po

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,10 @@ msgctxt "tfrmeditor.acteditselectall.hint"
10061006
msgid "Select All"
10071007
msgstr "Абраць усё"
10081008

1009+
#: tfrmeditor.actedittimedate.caption
1010+
msgid "Time/Date"
1011+
msgstr ""
1012+
10091013
#: tfrmeditor.acteditundo.caption
10101014
msgctxt "TFRMEDITOR.ACTEDITUNDO.CAPTION"
10111015
msgid "Undo"
@@ -10917,6 +10921,16 @@ msgstr ""
1091710921
msgid "HorzSplit"
1091810922
msgstr ""
1091910923

10924+
#: ulng.rsmfstbiiclouddrivertips
10925+
msgctxt "ulng.rsmfstbiiclouddrivertips"
10926+
msgid "iCloud Driver"
10927+
msgstr ""
10928+
10929+
#: ulng.rsmfstbiiclouddrivertitle
10930+
msgctxt "ulng.rsmfstbiiclouddrivertitle"
10931+
msgid "iCloud Driver"
10932+
msgstr ""
10933+
1092010934
#: ulng.rsmfstbiprivilegetips
1092110935
msgid "As a file manager, Double Command requires full disk access permissions. Clicking this button will pop up the macOS system settings page. Please add \"Double Commander.app\" to the \"Full Disk Access\" list to complete the authorization."
1092210936
msgstr ""
@@ -11055,6 +11069,14 @@ msgstr "Выняць"
1105511069
msgid "Extract here..."
1105611070
msgstr "Распакаваць сюды..."
1105711071

11072+
#: ulng.rsmnuiclouddriverdownloadnow
11073+
msgid "Download Now"
11074+
msgstr ""
11075+
11076+
#: ulng.rsmnuiclouddriverremovedownload
11077+
msgid "Remove Download"
11078+
msgstr ""
11079+
1105811080
#: ulng.rsmnumount
1105911081
msgid "Mount"
1106011082
msgstr "Прымантаваць"

language/doublecmd.bg.po

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,10 @@ msgctxt "tfrmeditor.acteditselectall.hint"
10271027
msgid "Select All"
10281028
msgstr "Избор на всички"
10291029

1030+
#: tfrmeditor.actedittimedate.caption
1031+
msgid "Time/Date"
1032+
msgstr ""
1033+
10301034
#: tfrmeditor.acteditundo.caption
10311035
msgctxt "TFRMEDITOR.ACTEDITUNDO.CAPTION"
10321036
msgid "Undo"
@@ -11391,6 +11395,16 @@ msgstr ""
1139111395
msgid "HorzSplit"
1139211396
msgstr ""
1139311397

11398+
#: ulng.rsmfstbiiclouddrivertips
11399+
msgctxt "ulng.rsmfstbiiclouddrivertips"
11400+
msgid "iCloud Driver"
11401+
msgstr ""
11402+
11403+
#: ulng.rsmfstbiiclouddrivertitle
11404+
msgctxt "ulng.rsmfstbiiclouddrivertitle"
11405+
msgid "iCloud Driver"
11406+
msgstr ""
11407+
1139411408
#: ulng.rsmfstbiprivilegetips
1139511409
msgid "As a file manager, Double Command requires full disk access permissions. Clicking this button will pop up the macOS system settings page. Please add \"Double Commander.app\" to the \"Full Disk Access\" list to complete the authorization."
1139611410
msgstr ""
@@ -11529,6 +11543,14 @@ msgstr "Изваждане"
1152911543
msgid "Extract here..."
1153011544
msgstr "Извличане тук..."
1153111545

11546+
#: ulng.rsmnuiclouddriverdownloadnow
11547+
msgid "Download Now"
11548+
msgstr ""
11549+
11550+
#: ulng.rsmnuiclouddriverremovedownload
11551+
msgid "Remove Download"
11552+
msgstr ""
11553+
1153211554
#: ulng.rsmnumount
1153311555
msgid "Mount"
1153411556
msgstr "Прикачане"

language/doublecmd.ca.po

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,10 @@ msgctxt "tfrmeditor.acteditselectall.hint"
11021102
msgid "Select All"
11031103
msgstr "Selecciona tot"
11041104

1105+
#: tfrmeditor.actedittimedate.caption
1106+
msgid "Time/Date"
1107+
msgstr ""
1108+
11051109
#: tfrmeditor.acteditundo.caption
11061110
msgctxt "TFRMEDITOR.ACTEDITUNDO.CAPTION"
11071111
msgid "Undo"
@@ -11880,6 +11884,16 @@ msgstr ""
1188011884
msgid "HorzSplit"
1188111885
msgstr ""
1188211886

11887+
#: ulng.rsmfstbiiclouddrivertips
11888+
msgctxt "ulng.rsmfstbiiclouddrivertips"
11889+
msgid "iCloud Driver"
11890+
msgstr ""
11891+
11892+
#: ulng.rsmfstbiiclouddrivertitle
11893+
msgctxt "ulng.rsmfstbiiclouddrivertitle"
11894+
msgid "iCloud Driver"
11895+
msgstr ""
11896+
1188311897
#: ulng.rsmfstbiprivilegetips
1188411898
msgid "As a file manager, Double Command requires full disk access permissions. Clicking this button will pop up the macOS system settings page. Please add \"Double Commander.app\" to the \"Full Disk Access\" list to complete the authorization."
1188511899
msgstr ""
@@ -12017,6 +12031,14 @@ msgstr "Expulsa"
1201712031
msgid "Extract here..."
1201812032
msgstr ""
1201912033

12034+
#: ulng.rsmnuiclouddriverdownloadnow
12035+
msgid "Download Now"
12036+
msgstr ""
12037+
12038+
#: ulng.rsmnuiclouddriverremovedownload
12039+
msgid "Remove Download"
12040+
msgstr ""
12041+
1202012042
#: ulng.rsmnumount
1202112043
msgid "Mount"
1202212044
msgstr "Munta"

0 commit comments

Comments
 (0)