Changeset 49 for trunk/IDE/UProject.pas


Ignore:
Timestamp:
Mar 4, 2012, 5:26:20 PM (13 years ago)
Author:
chronos
Message:
  • Added: Compiled target code now can be browsed using Target project navigation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE/UProject.pas

    r48 r49  
    4141  private
    4242    FModified: Boolean;
     43    function GetAbsoluteFileName: string;
    4344    procedure SetModified(const AValue: Boolean);
    4445  public
     
    5354    procedure Save;
    5455    property Modified: Boolean read FModified write SetModified;
     56    property AbsoluteFileName: string read GetAbsoluteFileName;
    5557  end;
    5658
     
    6062    Parent: TProject;
    6163    procedure DumpFileList(Files: TListString);
     64    procedure LoadFromList(Files: TListString);
    6265    procedure Load;
    6366    procedure Save;
     
    170173  Files.Clear;
    171174  for I := 0 to Count - 1 do
    172     Files.Add(TProjectFile(Items[I]).FileName);
     175    Files.Add(TProjectFile(Items[I]).AbsoluteFileName);
     176end;
     177
     178procedure TProjectFileList.LoadFromList(Files: TListString);
     179var
     180  I: Integer;
     181  NewFile: TProjectFile;
     182  FileName: string;
     183begin
     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;
    173193end;
    174194
     
    245265end;
    246266
     267function TProjectFile.GetAbsoluteFileName: string;
     268begin
     269  Result := ExtractFileDir(Parent.FileName) + DirectorySeparator + FileName;
     270end;
     271
    247272constructor TProjectFile.Create;
    248273begin
     
    277302      FileName := UTF8Encode(NewNode.TextContent);
    278303  end;
    279   if FileExistsUTF8(ExtractFileDir(Parent.FileName) + DirectorySeparator + FileName) then Load;
     304  if FileExistsUTF8(AbsoluteFileName) then Load;
    280305end;
    281306
    282307procedure TProjectFile.Load;
    283308begin
    284   Source.LoadFromFile(ExtractFileDir(Parent.FileName) + DirectorySeparator + FileName);
     309  Source.LoadFromFile(AbsoluteFileName);
    285310end;
    286311
Note: See TracChangeset for help on using the changeset viewer.