Changeset 122 for trunk/Packages/Common/UFindFile.pas
- Timestamp:
- Jun 29, 2018, 11:44:07 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UFindFile.pas
r84 r122 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 … … 55 55 end; 56 56 57 const 58 {$IFDEF WINDOWS} 59 FilterAll = '*.*'; 60 {$ENDIF} 61 {$IFDEF LINUX} 62 FilterAll = '*'; 63 {$ENDIF} 64 57 65 procedure Register; 58 66 … … 64 72 procedure Register; 65 73 begin 66 RegisterComponents(' Samples', [TFindFile]);74 RegisterComponents('Common', [TFindFile]); 67 75 end; 68 76 … … 71 79 inherited Create(AOwner); 72 80 Path := IncludeTrailingBackslash(UTF8Encode(GetCurrentDir)); 73 FileMask := '*.*';81 FileMask := FilterAll; 74 82 FileAttr := [ffaAnyFile]; 75 83 s := TStringList.Create; … … 109 117 Attr := 0; 110 118 if ffaReadOnly in FileAttr then Attr := Attr + faReadOnly; 111 if ffaHidden in FileAttr then Attr := Attr + faHidden;112 if ffaSysFile in FileAttr then Attr := Attr + faSysFile;113 if ffaVolumeID in FileAttr then Attr := Attr + faVolumeID;119 if ffaHidden in FileAttr then Attr := Attr + 2; //faHidden; use constant to avoid platform warning 120 if ffaSysFile in FileAttr then Attr := Attr + 4; //faSysFile; use constant to avoid platform warning 121 // Deprecated: if ffaVolumeID in FileAttr then Attr := Attr + faVolumeID; 114 122 if ffaDirectory in FileAttr then Attr := Attr + faDirectory; 115 123 if ffaArchive in FileAttr then Attr := Attr + faArchive; 116 124 if ffaAnyFile in FileAttr then Attr := Attr + faAnyFile; 117 125 118 if SysUtils.FindFirst( UTF8Decode(inPath + FileMask), Attr, Rec) = 0 then126 if SysUtils.FindFirst(inPath + FileMask, Attr, Rec) = 0 then 119 127 try 120 128 repeat 121 s.Add(inPath + UTF8Encode(Rec.Name));129 s.Add(inPath + Rec.Name); 122 130 until SysUtils.FindNext(Rec) <> 0; 123 131 finally … … 127 135 If not InSubFolders then Exit; 128 136 129 if SysUtils.FindFirst( UTF8Decode(inPath + '*.*'), faDirectory, Rec) = 0 then137 if SysUtils.FindFirst(inPath + FilterAll, faDirectory, Rec) = 0 then 130 138 try 131 139 repeat 132 140 if ((Rec.Attr and faDirectory) > 0) and (Rec.Name <> '.') 133 141 and (Rec.Name <> '..') then 134 FileSearch(IncludeTrailingBackslash(inPath + UTF8Encode(Rec.Name)));142 FileSearch(IncludeTrailingBackslash(inPath + Rec.Name)); 135 143 until SysUtils.FindNext(Rec) <> 0; 136 144 finally
Note:
See TracChangeset
for help on using the changeset viewer.