Changeset 57 for trunk/IDE/UProject.pas


Ignore:
Timestamp:
Jul 16, 2012, 4:11:47 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Testing interpretter.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE/UProject.pas

    r54 r57  
    7373  TProject = class
    7474  private
    75     FActive: Boolean;
    7675    FModified: Boolean;
    7776    FOnChange: TNotifyEvent;
     
    239238var
    240239  I: Integer;
    241 begin
     240  ParentDir: string;
     241begin
     242  ParentDir := ExtractFileDir(Parent.FileName);
     243  if Copy(FileName, 1, Length(ParentDir)) = ParentDir then
     244    System.Delete(FileName, 1, Length(ParentDir) + 1);
    242245  I := 0;
    243246  while (I < Count) and (TProjectFile(Items[I]).FileName <> FileName) do Inc(I);
     
    309312procedure TProjectFile.Save;
    310313begin
    311   if Modified then
    312     Source.SaveToFile(FileName);
     314  Source.SaveToFile(AbsoluteFileName);
    313315end;
    314316
     
    319321  if FModified = AValue then Exit;
    320322  FModified := AValue;
     323  if Assigned(FOnChange) then FOnChange(Self);
    321324end;
    322325
     
    364367begin
    365368  Doc := TXMLDocument.Create;
     369  Self.FileName := FileName;
    366370  with Doc do try
    367371    RootNode := CreateElement('Project');
     
    395399
    396400procedure TProject.Save;
     401var
     402  I: Integer;
    397403begin
    398404  Files.Save;
    399405  Packages.Save;
     406  for I := 0 to Files.Count - 1 do
     407    TProjectFile(Files[I]).Modified := False;
     408  Modified := False;
    400409end;
    401410
Note: See TracChangeset for help on using the changeset viewer.