Changeset 15 for trunk/Forms/UFormBrowse.pas
- Timestamp:
- Jul 13, 2015, 11:44:23 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormBrowse.pas
r11 r15 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ExtCtrls, Menus, ActnList, UFindFile, UVCS ;9 ExtCtrls, Menus, ActnList, UFindFile, UVCS, Contnrs; 10 10 11 11 type … … 23 23 ActionList1: TActionList; 24 24 ListView1: TListView; 25 MainMenu1: TMainMenu; 25 26 MenuItem1: TMenuItem; 26 27 MenuItem2: TMenuItem; … … 46 47 Selected: Boolean); 47 48 private 48 FileList: T StringList;49 FileList: TObjectList; 49 50 public 50 51 Directory: string; … … 67 68 procedure TFormBrowse.ListView1Data(Sender: TObject; Item: TListItem); 68 69 begin 69 if (Item.Index >= 0) and (Item.Index < FileList.Count) then begin 70 Item.Caption := ExtractFileName(FileList[Item.Index]); 70 if (Item.Index >= 0) and (Item.Index < FileList.Count) then 71 with TFileStatus(FileList[Item.Index]) do begin 72 Item.Caption := ExtractFileName(FileName); 73 if State <> fssNonVersioned then begin 74 Item.SubItems.Add(Version); 75 Item.SubItems.Add(DateToStr(Time)); 76 Item.SubItems.Add(Author); 77 Item.SubItems.Add(FileStatusStateText[State]); 78 end; 71 79 end; 72 80 end; … … 124 132 procedure TFormBrowse.FormCreate(Sender: TObject); 125 133 begin 126 FileList := T StringList.Create;134 FileList := TObjectList.Create; 127 135 end; 128 136 … … 142 150 FoundFileList: TStrings; 143 151 I: Integer; 144 begin 152 FileStatusList: TFileStatusList; 153 NewFileItem: TFileStatus; 154 FS: TFileStatus; 155 RelativeName: string; 156 begin 157 FileList.Clear; 158 if Assigned(Core.Project) then begin 159 FileStatusList := TFileStatusList.Create; 160 try 161 Core.Project.WorkingCopy.GetStatus(Directory, FileStatusList); 162 145 163 if DirectoryExistsUTF8(Directory) then begin 146 164 FindFile := TFindFile.Create(nil); … … 150 168 FindFile.InSubFolders := False; 151 169 FoundFileList := FindFile.SearchForFiles; 152 FileList.Assign(FoundFileList); 170 //FoundFileList.Sort; 171 for I := 0 to FoundFileList.Count - 1 do begin 172 NewFileItem := TFileStatus.Create; 173 NewFileItem.FileName := FoundFileList[I]; 174 RelativeName := NewFileItem.FileName; 175 if Copy(RelativeName, 1, Length(Core.Project.WorkingCopy.Path)) = Core.Project.WorkingCopy.Path then 176 Delete(RelativeName, 1, Length(Core.Project.WorkingCopy.Path)); 177 if Copy(RelativeName, 1, 1) = DirectorySeparator then 178 Delete(RelativeName, 1, Length(DirectorySeparator)); 179 FS := FileStatusList.SearchByName(RelativeName); 180 if Assigned(FS) then begin 181 NewFileItem.Assign(FS); 182 end; 183 FileList.Add(NewFileItem); 184 end; 153 185 for I := FileList.Count - 1 downto 0 do 154 if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I); 155 FileList.Sort; 186 if ExtractFileName(TFileStatus(FileList[I]).FileName) = '.' then FileList.Delete(I); 156 187 ListView1.Items.Count := FileList.Count; 157 188 finally … … 159 190 end; 160 191 end else ListView1.Items.Count := 0; 192 finally 193 FileStatusList.Free; 194 end; 195 end; 161 196 ListView1.Refresh; 162 197 end;
Note:
See TracChangeset
for help on using the changeset viewer.