View Issue Details

IDProjectCategoryView StatusLast Update
0031281LazarusLCLpublic2017-01-28 16:17
Reporterdave LiewaldAssigned ToBart Broersma 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinux & WindowsOSOS Version
Product Version1.6.2Product Build 
Target Version1.6.4Fixed in Version1.6.3 (SVN) 
Summary0031281: in tfilelistbox ftdirectory doesn't function
Descriptionsetting a tfilelistbox filter to tdirectory displays both files and directories
Steps To Reproducedrop filelistbox on form point at directory of mixed files and subdirs set filetype to ftDirectory
Additional InformationAdding line fixes

repeat
        if MatchesMaskList(Info.Name,Mask) then
        begin
          if (ftNormal in FileType) or ((Info.Attr and AttrNotNormal) > 0) then
          begin
            if (Info.Attr and faDirectory) > 0 then
              Items.Add('['+Info.Name+']')
            else
               if FileType <> [ftDirectory] then // This line added!!!!
              Items.Add(Info.Name);
          end;
        end;
      until FindNextUTF8(Info) <> 0;
    FindCloseUTF8(Info);
  end;
TagsNo tags attached.
Fixed in Revisionr54025
LazTarget1.6.4
WidgetsetGTK 2
Attached Files

Activities

Bart Broersma

2017-01-27 16:07

developer   ~0097737

IIRC this is compatible with Delphi.
It is just like Attributes in FindFirst/FindNext.
If you do not specify directories it will not show them.
It will always show files.

dave Liewald

2017-01-27 16:19

reporter  

FileList.png (26,250 bytes)
FileList.png (26,250 bytes)

dave Liewald

2017-01-27 16:21

reporter   ~0097738

please see attached png for delphi selecting directory shows ownly directories not directories and files

Bart Broersma

2017-01-27 18:06

developer   ~0097742

You are right, Delphi indeed does not show files in this case.

Bart Broersma

2017-01-27 19:39

developer   ~0097744

Your solution won't work if FileType = [faVolumeID]...

Bart Broersma

2017-01-28 16:17

developer   ~0097765

Please test and close if OK.
I also made the behaviour more consistent with D7.

Issue History

Date Modified Username Field Change
2017-01-27 14:25 dave Liewald New Issue
2017-01-27 16:07 Bart Broersma Note Added: 0097737
2017-01-27 16:19 dave Liewald File Added: FileList.png
2017-01-27 16:21 dave Liewald Note Added: 0097738
2017-01-27 18:06 Bart Broersma Note Added: 0097742
2017-01-27 18:06 Bart Broersma Assigned To => Bart Broersma
2017-01-27 18:06 Bart Broersma Status new => assigned
2017-01-27 19:39 Bart Broersma Note Added: 0097744
2017-01-28 16:17 Bart Broersma Fixed in Revision => r54025
2017-01-28 16:17 Bart Broersma LazTarget => 1.6.4
2017-01-28 16:17 Bart Broersma Note Added: 0097765
2017-01-28 16:17 Bart Broersma Status assigned => resolved
2017-01-28 16:17 Bart Broersma Fixed in Version => 1.6.3 (SVN)
2017-01-28 16:17 Bart Broersma Resolution open => fixed
2017-01-28 16:17 Bart Broersma Target Version => 1.6.4