diff options
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r-- | src/corelib/gdi/gfx_gdi.pas | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas index e620ac26..b2f6970b 100644 --- a/src/corelib/gdi/gfx_gdi.pas +++ b/src/corelib/gdi/gfx_gdi.pas @@ -209,7 +209,12 @@ type end; + { TfpgFileListImpl } + TfpgFileListImpl = class(TfpgFileListBase) + function EncodeAttributesString(attrs: longword): TFileModeString; + constructor Create; override; + function InitializeEntry(sr: TSearchRec): TFileEntry; override; procedure PopulateSpecialDirs(const aDirectory: TfpgString); override; end; @@ -2020,6 +2025,35 @@ end; { TfpgFileListImpl } +function TfpgFileListImpl.EncodeAttributesString(attrs: longword + ): TFileModeString; +begin + Result := ''; + //if (attrs and FILE_ATTRIBUTE_ARCHIVE) <> 0 then s := s + 'a' else s := s + ' '; + if (attrs and FILE_ATTRIBUTE_HIDDEN) <> 0 then Result := Result + 'h'; + if (attrs and FILE_ATTRIBUTE_READONLY) <> 0 then Result := Result + 'r'; + if (attrs and FILE_ATTRIBUTE_SYSTEM) <> 0 then Result := Result + 's'; + if (attrs and FILE_ATTRIBUTE_TEMPORARY) <> 0 then Result := Result + 't'; + if (attrs and FILE_ATTRIBUTE_COMPRESSED) <> 0 then Result := Result + 'c'; +end; + +constructor TfpgFileListImpl.Create; +begin + inherited Create; + FHasFileMode := false; +end; + +function TfpgFileListImpl.InitializeEntry(sr: TSearchRec): TFileEntry; +begin + Result := inherited InitializeEntry(sr); + if Assigned(Result) then + begin + // using sr.Attr here is incorrect and needs to be improved! + Result.Attributes := EncodeAttributesString(sr.Attr); + Result.IsExecutable := (LowerCase(Result.Extension) = '.exe'); + end; +end; + procedure TfpgFileListImpl.PopulateSpecialDirs(const aDirectory: TfpgString); const MAX_DRIVES = 25; |