Changeset 23 for trunk/IDE/UProject.pas


Ignore:
Timestamp:
Nov 10, 2010, 7:26:52 AM (14 years ago)
Author:
george
Message:
  • Fixed: Saving project file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE/UProject.pas

    r21 r23  
    125125  NewNode: TDOMNode;
    126126begin
     127  TDOMElement(Node).SetAttribute('Name', UTF8Decode(Name));
    127128  inherited SaveToXMLNode(Node);
    128129  with Node do begin
    129     NewNode := OwnerDocument.CreateElement('File');
     130    NewNode := OwnerDocument.CreateElement('Folder');
    130131    TDOMElement(NewNode).SetAttribute('Name', UTF8Decode(Name));
    131     TDOMElement(NewNode).SetAttribute('Type', 'File');
    132132    AppendChild(NewNode);
    133133  end;
     
    171171
    172172procedure TProjectFile.SaveToXMLNode(Node: TDOMNode);
     173var
     174  NewNode: TDOMNode;
    173175begin
    174176  inherited SaveToXMLNode(Node);
     177  with Node do begin
     178    NewNode := OwnerDocument.CreateElement('File');
     179    TDOMElement(NewNode).SetAttribute('Name', UTF8Decode(Name));
     180    AppendChild(NewNode);
     181  end;
    175182  Save;
    176183end;
     
    235242    Clear;
    236243    RootDir := ExtractFileDir(FileName) + '/';
     244    //NewNode := Doc.DocumentElement.FindNode('Files');
    237245    Name := ExtractFileName(FileName);
    238246    Name := Copy(Name, 1, Length(Name) - Length(ExtractFileExt(FileName)));
     
    240248    ReadXMLFile(Doc, UTF8Decode(FileName));
    241249
    242     NewNode := Doc.DocumentElement.FindNode('Files');
     250    NewNode := Doc.DocumentElement.FindNode('Folder');
    243251    if Assigned(NewNode) then
    244252      LoadFromXMLNode(NewNode);
     
    257265  Child := Node.FirstChild;
    258266  while Assigned(Child) do begin
    259     NodeType := TDOMElement(Child).GetAttribute('Type');
    260     if NodeType = 'Folder' then
     267    if Child.NodeName = 'Folder' then
    261268      ProjectNode := TProjectGroup.Create
    262     else if NodeType = 'File' then
     269    else if Child.NodeName = 'File' then
    263270      ProjectNode := TProjectFile.Create
    264271    else ProjectNode := nil;
     
    287294    AppendChild(RootNode);
    288295    with RootNode do begin
    289       NewNode := OwnerDocument.CreateElement('Files');
    290       SaveToXMLNode(NewNode);
    291296    end;
     297    SaveToXMLNode(RootNode);
    292298    WriteXMLFile(Doc, UTF8Decode(FileName));
    293299  finally
Note: See TracChangeset for help on using the changeset viewer.