Changeset 8 for trunk/Forms/UFormBrowse.pas
- Timestamp:
- May 18, 2015, 12:15:30 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormBrowse.pas
r7 r8 33 33 procedure ADeleteExecute(Sender: TObject); 34 34 procedure AOpenExecute(Sender: TObject); 35 procedure FormCreate(Sender: TObject); 36 procedure FormDestroy(Sender: TObject); 35 37 procedure ListView1Data(Sender: TObject; Item: TListItem); 36 38 procedure ListView1DblClick(Sender: TObject); … … 83 85 end; 84 86 87 procedure TFormBrowse.FormCreate(Sender: TObject); 88 begin 89 FileList := TStringList.Create; 90 end; 91 92 procedure TFormBrowse.FormDestroy(Sender: TObject); 93 begin 94 FileList.Free; 95 end; 96 85 97 procedure TFormBrowse.ReloadList; 86 98 var 87 99 FindFile: TFindFile; 100 FoundFileList: TStrings; 88 101 I: Integer; 89 102 begin 90 FindFile := TFindFile.Create(nil); 91 FindFile.Path := Directory; 92 FindFile.FileMask := AllFilesMask; 93 FindFile.InSubFolders := False; 94 FileList := FindFile.SearchForFiles; 95 for I := FileList.Count - 1 downto 0 do 96 if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I); 97 FileList.Sort; 98 ListView1.Items.Count := FileList.Count; 103 if DirectoryExistsUTF8(Directory) then begin 104 FindFile := TFindFile.Create(nil); 105 try 106 FindFile.Path := Directory; 107 FindFile.FileMask := AllFilesMask; 108 FindFile.InSubFolders := False; 109 FoundFileList := FindFile.SearchForFiles; 110 FileList.Assign(FoundFileList); 111 for I := FileList.Count - 1 downto 0 do 112 if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I); 113 FileList.Sort; 114 ListView1.Items.Count := FileList.Count; 115 finally 116 FindFile.Free; 117 end; 118 end else ListView1.Items.Count := 0; 99 119 ListView1.Refresh; 100 120 end;
Note:
See TracChangeset
for help on using the changeset viewer.