Changeset 75 for trunk/IDE/Project.pas
- Timestamp:
- Jun 4, 2024, 12:22:49 AM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Project.pas
r74 r75 1 unit UProject; 2 3 {$mode Delphi}{$H+} 1 unit Project; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, Dialogs, DOM, XMLWrite, XMLRead, FileUtil, 9 SpecializedList;7 Generics.Collections; 10 8 11 9 const … … 19 17 end; 20 18 21 { TProjectPackage List}22 23 TProjectPackage List = class(TListObject)19 { TProjectPackages } 20 21 TProjectPackages = class(TObjectList<TProjectPackage>) 24 22 Parent: TProject; 25 23 procedure Load; … … 33 31 end; 34 32 35 TProjectBuildConfig List = class(TListObject)33 TProjectBuildConfigs = class(TObjectList<TProjectBuildConfig>) 36 34 end; 37 35 … … 57 55 end; 58 56 59 { TProjectFile List}60 61 TProjectFile List = class(TListObject)57 { TProjectFiles } 58 59 TProjectFiles = class(TObjectList<TProjectFile>) 62 60 Parent: TProject; 63 procedure DumpFileList(Files: T ListString);64 procedure LoadFromList(Files: T ListString);61 procedure DumpFileList(Files: TStringList); 62 procedure LoadFromList(Files: TStringList); 65 63 procedure Load; 66 64 procedure Save; … … 78 76 public 79 77 FileName: string; 80 Files: TProjectFile List;81 Packages: TProjectPackage List;82 BuildConfigs: TProjectBuildConfig List;78 Files: TProjectFiles; 79 Packages: TProjectPackages; 80 BuildConfigs: TProjectBuildConfigs; 83 81 MainSource: TProjectFile; 84 82 procedure LoadFromFile(FileName: string); … … 104 102 end; 105 103 106 { TProjectTemplate List}107 108 TProjectTemplate List = class(TListObject)104 { TProjectTemplates } 105 106 TProjectTemplates = class(TObjectList<TProjectTemplate>) 109 107 procedure AddTemplate(Template: TProjectTemplate); 110 108 end; … … 113 111 SNewProject = 'New project'; 114 112 113 115 114 implementation 116 115 117 { TProjectTemplate List}118 119 procedure TProjectTemplate List.AddTemplate(Template: TProjectTemplate);116 { TProjectTemplates } 117 118 procedure TProjectTemplates.AddTemplate(Template: TProjectTemplate); 120 119 begin 121 120 Add(Template); … … 136 135 destructor TProjectTemplate.Destroy; 137 136 begin 138 Description.Free; 139 inherited Destroy; 140 end; 141 142 { TProjectPackageList } 143 144 procedure TProjectPackageList.Load; 145 begin 146 147 end; 148 149 procedure TProjectPackageList.Save; 150 begin 151 152 end; 153 154 procedure TProjectPackageList.SaveToXMLNode(Node: TDOMNode); 155 begin 156 157 end; 158 159 procedure TProjectPackageList.LoadFromXMLNode(Node: TDOMNode); 160 begin 161 137 FreeAndNil(Description); 138 inherited; 139 end; 140 141 { TProjectPackages } 142 143 procedure TProjectPackages.Load; 144 begin 145 end; 146 147 procedure TProjectPackages.Save; 148 begin 149 end; 150 151 procedure TProjectPackages.SaveToXMLNode(Node: TDOMNode); 152 begin 153 end; 154 155 procedure TProjectPackages.LoadFromXMLNode(Node: TDOMNode); 156 begin 162 157 end; 163 158 164 159 { TProjectGroup } 165 160 166 procedure TProjectFile List.DumpFileList(Files: TListString);161 procedure TProjectFiles.DumpFileList(Files: TStringList); 167 162 var 168 163 I: Integer; … … 173 168 end; 174 169 175 procedure TProjectFile List.LoadFromList(Files: TListString);170 procedure TProjectFiles.LoadFromList(Files: TStringList); 176 171 var 177 172 I: Integer; … … 190 185 end; 191 186 192 procedure TProjectFile List.Load;187 procedure TProjectFiles.Load; 193 188 var 194 189 I: Integer; … … 198 193 end; 199 194 200 procedure TProjectFile List.Save;195 procedure TProjectFiles.Save; 201 196 var 202 197 I: Integer; … … 206 201 end; 207 202 208 procedure TProjectFile List.SaveToXMLNode(Node: TDOMNode);203 procedure TProjectFiles.SaveToXMLNode(Node: TDOMNode); 209 204 var 210 205 I: Integer; … … 219 214 end; 220 215 221 procedure TProjectFile List.LoadFromXMLNode(Node: TDOMNode);216 procedure TProjectFiles.LoadFromXMLNode(Node: TDOMNode); 222 217 var 223 218 NewNode: TDomNode; … … 236 231 end; 237 232 238 function TProjectFile List.SearchFile(FileName: string): TProjectFile;233 function TProjectFiles.SearchFile(FileName: string): TProjectFile; 239 234 var 240 235 I: Integer; … … 250 245 end; 251 246 252 function TProjectFile List.AddFile(FileName: string): TProjectFile;253 begin 254 Result := TProjectFile (AddNew(TProjectFile.Create));247 function TProjectFiles.AddFile(FileName: string): TProjectFile; 248 begin 249 Result := TProjectFile.Create; 255 250 Result.Parent := Parent; 256 251 Result.FileName := FileName; 252 Add(Result); 257 253 end; 258 254 … … 278 274 destructor TProjectFile.Destroy; 279 275 begin 280 Source.Free;281 inherited Destroy;276 FreeAndNil(Source); 277 inherited; 282 278 end; 283 279 … … 419 415 constructor TProject.Create; 420 416 begin 421 Files := TProjectFile List.Create;417 Files := TProjectFiles.Create; 422 418 Files.Parent := Self; 423 Packages := TProjectPackage List.Create;419 Packages := TProjectPackages.Create; 424 420 Packages.Parent := Self; 425 421 end; … … 427 423 destructor TProject.Destroy; 428 424 begin 429 F iles.Free;430 Packages.Free;431 BuildConfigs.Free;432 inherited Destroy;425 FreeAndNil(Files); 426 FreeAndNil(Packages); 427 FreeAndNil(BuildConfigs); 428 inherited; 433 429 end; 434 430
Note:
See TracChangeset
for help on using the changeset viewer.