Changeset 49 for trunk/IDE/UProject.pas
- Timestamp:
- Mar 4, 2012, 5:26:20 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/UProject.pas
r48 r49 41 41 private 42 42 FModified: Boolean; 43 function GetAbsoluteFileName: string; 43 44 procedure SetModified(const AValue: Boolean); 44 45 public … … 53 54 procedure Save; 54 55 property Modified: Boolean read FModified write SetModified; 56 property AbsoluteFileName: string read GetAbsoluteFileName; 55 57 end; 56 58 … … 60 62 Parent: TProject; 61 63 procedure DumpFileList(Files: TListString); 64 procedure LoadFromList(Files: TListString); 62 65 procedure Load; 63 66 procedure Save; … … 170 173 Files.Clear; 171 174 for I := 0 to Count - 1 do 172 Files.Add(TProjectFile(Items[I]).FileName); 175 Files.Add(TProjectFile(Items[I]).AbsoluteFileName); 176 end; 177 178 procedure TProjectFileList.LoadFromList(Files: TListString); 179 var 180 I: Integer; 181 NewFile: TProjectFile; 182 FileName: string; 183 begin 184 Clear; 185 for I := 0 to Files.Count - 1 do begin 186 FileName := Files[I]; 187 if Copy(FileName, 1, Length(ExtractFileDir(Parent.FileName))) = 188 ExtractFileDir(Parent.FileName) then 189 System.Delete(FileName, 1, Length(ExtractFileDir(Parent.FileName)) + 1); 190 NewFile := AddFile(FileName); 191 NewFile.Load; 192 end; 173 193 end; 174 194 … … 245 265 end; 246 266 267 function TProjectFile.GetAbsoluteFileName: string; 268 begin 269 Result := ExtractFileDir(Parent.FileName) + DirectorySeparator + FileName; 270 end; 271 247 272 constructor TProjectFile.Create; 248 273 begin … … 277 302 FileName := UTF8Encode(NewNode.TextContent); 278 303 end; 279 if FileExistsUTF8( ExtractFileDir(Parent.FileName) + DirectorySeparator +FileName) then Load;304 if FileExistsUTF8(AbsoluteFileName) then Load; 280 305 end; 281 306 282 307 procedure TProjectFile.Load; 283 308 begin 284 Source.LoadFromFile( ExtractFileDir(Parent.FileName) + DirectorySeparator +FileName);309 Source.LoadFromFile(AbsoluteFileName); 285 310 end; 286 311
Note:
See TracChangeset
for help on using the changeset viewer.