Ignore:
Timestamp:
May 18, 2015, 12:15:30 AM (9 years ago)
Author:
chronos
Message:
  • Added: Checkout form and ability to checkout new working copy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormBrowse.pas

    r7 r8  
    3333    procedure ADeleteExecute(Sender: TObject);
    3434    procedure AOpenExecute(Sender: TObject);
     35    procedure FormCreate(Sender: TObject);
     36    procedure FormDestroy(Sender: TObject);
    3537    procedure ListView1Data(Sender: TObject; Item: TListItem);
    3638    procedure ListView1DblClick(Sender: TObject);
     
    8385end;
    8486
     87procedure TFormBrowse.FormCreate(Sender: TObject);
     88begin
     89  FileList := TStringList.Create;
     90end;
     91
     92procedure TFormBrowse.FormDestroy(Sender: TObject);
     93begin
     94  FileList.Free;
     95end;
     96
    8597procedure TFormBrowse.ReloadList;
    8698var
    8799  FindFile: TFindFile;
     100  FoundFileList: TStrings;
    88101  I: Integer;
    89102begin
    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;
    99119  ListView1.Refresh;
    100120end;
Note: See TracChangeset for help on using the changeset viewer.