mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: sort() in TFiles
This commit is contained in:
parent
77a97865cf
commit
dd3f3f70db
2 changed files with 16 additions and 2 deletions
|
|
@ -864,7 +864,7 @@ begin
|
|||
strings.AddObject( self.GetFileName(f), attr );
|
||||
end;
|
||||
|
||||
if strings.Count > 0 then begin
|
||||
if strings.Count > 1 then begin
|
||||
case sort of
|
||||
fstAlphabet: strings.CustomSort(@FilesSortAlphabet);
|
||||
fstFoldersFirst: strings.CustomSort(@FilesSortFoldersFirst);
|
||||
|
|
|
|||
|
|
@ -242,6 +242,8 @@ type
|
|||
procedure Delete(AtIndex: Integer);
|
||||
procedure Clear;
|
||||
|
||||
procedure sort;
|
||||
|
||||
function allFilesAtSamePath: Boolean;
|
||||
procedure setPathBaseOnAllFiles;
|
||||
|
||||
|
|
@ -251,7 +253,6 @@ type
|
|||
property OwnsObjects: Boolean read FOwnsObjects write FOwnsObjects;
|
||||
property Path: String read FPath write SetPath;
|
||||
property Flat: Boolean read FFlat write FFlat;
|
||||
|
||||
end;
|
||||
|
||||
{en
|
||||
|
|
@ -970,6 +971,19 @@ begin
|
|||
FList.Clear;
|
||||
end;
|
||||
|
||||
function simpleCompare(Item1, Item2: Pointer): Integer;
|
||||
var
|
||||
file1: TFile absolute Item1;
|
||||
file2: TFile absolute Item2;
|
||||
begin
|
||||
Result:= CompareStr( file1.FullPath, file2.FullPath );
|
||||
end;
|
||||
|
||||
procedure TFiles.sort;
|
||||
begin
|
||||
FList.Sort( @simpleCompare);
|
||||
end;
|
||||
|
||||
function TFiles.allFilesAtSamePath: Boolean;
|
||||
var
|
||||
checkPath: String;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue