Ignore:
Timestamp:
Jun 29, 2018, 11:44:07 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
  • Modified: Updated IPTV prices.
  • Added: deb package build script.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UFindFile.pas

    r84 r122  
    2424
    2525uses
    26   SysUtils, Classes, Graphics, Controls, Forms, Dialogs, FileCtrl;
     26  SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
    2727
    2828type
     
    5555  end;
    5656
     57const
     58{$IFDEF WINDOWS}
     59  FilterAll = '*.*';
     60{$ENDIF}
     61{$IFDEF LINUX}
     62  FilterAll = '*';
     63{$ENDIF}
     64
    5765procedure Register;
    5866
     
    6472procedure Register;
    6573begin
    66   RegisterComponents('Samples', [TFindFile]);
     74  RegisterComponents('Common', [TFindFile]);
    6775end;
    6876
     
    7179  inherited Create(AOwner);
    7280  Path := IncludeTrailingBackslash(UTF8Encode(GetCurrentDir));
    73   FileMask := '*.*';
     81  FileMask := FilterAll;
    7482  FileAttr := [ffaAnyFile];
    7583  s := TStringList.Create;
     
    109117  Attr := 0;
    110118  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;
    114122  if ffaDirectory in FileAttr then Attr := Attr + faDirectory;
    115123  if ffaArchive in FileAttr then Attr := Attr + faArchive;
    116124  if ffaAnyFile in FileAttr then Attr := Attr + faAnyFile;
    117125
    118   if SysUtils.FindFirst(UTF8Decode(inPath + FileMask), Attr, Rec) = 0 then
     126  if SysUtils.FindFirst(inPath + FileMask, Attr, Rec) = 0 then
    119127  try
    120128    repeat
    121       s.Add(inPath + UTF8Encode(Rec.Name));
     129      s.Add(inPath + Rec.Name);
    122130    until SysUtils.FindNext(Rec) <> 0;
    123131  finally
     
    127135  If not InSubFolders then Exit;
    128136
    129   if SysUtils.FindFirst(UTF8Decode(inPath + '*.*'), faDirectory, Rec) = 0 then
     137  if SysUtils.FindFirst(inPath + FilterAll, faDirectory, Rec) = 0 then
    130138  try
    131139    repeat
    132140      if ((Rec.Attr and faDirectory) > 0) and (Rec.Name <> '.')
    133141      and (Rec.Name <> '..') then
    134         FileSearch(IncludeTrailingBackslash(inPath + UTF8Encode(Rec.Name)));
     142        FileSearch(IncludeTrailingBackslash(inPath + Rec.Name));
    135143    until SysUtils.FindNext(Rec) <> 0;
    136144  finally
Note: See TracChangeset for help on using the changeset viewer.