Changeset 25 for trunk/Packages/Common/UFindFile.pas
- Timestamp:
- Sep 10, 2022, 6:54:43 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UFindFile.pas
r15 r25 24 24 25 25 uses 26 SysUtils, Classes, Graphics, Controls, Forms, Dialogs , FileCtrl;26 SysUtils, Classes, Graphics, Controls, Forms, Dialogs; 27 27 28 28 type … … 35 35 private 36 36 s : TStringList; 37 38 37 fSubFolder : boolean; 39 38 fAttr: TFileAttrib; 40 39 fPath : string; 41 40 fFileMask : string; 42 43 41 procedure SetPath(Value: string); 44 42 procedure FileSearch(const inPath : string); … … 46 44 constructor Create(AOwner: TComponent); override; 47 45 destructor Destroy; override; 48 49 46 function SearchForFiles: TStringList; 50 47 published … … 59 56 FilterAll = '*.*'; 60 57 {$ENDIF} 61 {$IFDEF LINUX}58 {$IFDEF UNIX} 62 59 FilterAll = '*'; 63 60 {$ENDIF} 64 61 65 62 procedure Register; 63 66 64 67 65 implementation … … 87 85 begin 88 86 s.Free; 89 inherited Destroy;87 inherited; 90 88 end; 91 89 … … 117 115 Attr := 0; 118 116 if ffaReadOnly in FileAttr then Attr := Attr + faReadOnly; 119 if ffaHidden in FileAttr then Attr := Attr + faHidden;120 if ffaSysFile in FileAttr then Attr := Attr + faSysFile;121 if ffaVolumeID in FileAttr then Attr := Attr + faVolumeID;117 if ffaHidden in FileAttr then Attr := Attr + 2; //faHidden; use constant to avoid platform warning 118 if ffaSysFile in FileAttr then Attr := Attr + 4; //faSysFile; use constant to avoid platform warning 119 // Deprecated: if ffaVolumeID in FileAttr then Attr := Attr + faVolumeID; 122 120 if ffaDirectory in FileAttr then Attr := Attr + faDirectory; 123 121 if ffaArchive in FileAttr then Attr := Attr + faArchive; 124 122 if ffaAnyFile in FileAttr then Attr := Attr + faAnyFile; 125 123 126 if SysUtils.FindFirst( UTF8Decode(inPath + FileMask), Attr, Rec) = 0 then124 if SysUtils.FindFirst(inPath + FileMask, Attr, Rec) = 0 then 127 125 try 128 126 repeat 129 s.Add(inPath + UTF8Encode(Rec.Name));127 s.Add(inPath + Rec.Name); 130 128 until SysUtils.FindNext(Rec) <> 0; 131 129 finally … … 135 133 If not InSubFolders then Exit; 136 134 137 if SysUtils.FindFirst( UTF8Decode(inPath + FilterAll), faDirectory, Rec) = 0 then135 if SysUtils.FindFirst(inPath + FilterAll, faDirectory, Rec) = 0 then 138 136 try 139 137 repeat 140 138 if ((Rec.Attr and faDirectory) > 0) and (Rec.Name <> '.') 141 139 and (Rec.Name <> '..') then 142 FileSearch(IncludeTrailingBackslash(inPath + UTF8Encode(Rec.Name)));140 FileSearch(IncludeTrailingBackslash(inPath + Rec.Name)); 143 141 until SysUtils.FindNext(Rec) <> 0; 144 142 finally
Note:
See TracChangeset
for help on using the changeset viewer.