Changeset 23 for trunk/IDE/UProject.pas
- Timestamp:
- Nov 10, 2010, 7:26:52 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/UProject.pas
r21 r23 125 125 NewNode: TDOMNode; 126 126 begin 127 TDOMElement(Node).SetAttribute('Name', UTF8Decode(Name)); 127 128 inherited SaveToXMLNode(Node); 128 129 with Node do begin 129 NewNode := OwnerDocument.CreateElement('F ile');130 NewNode := OwnerDocument.CreateElement('Folder'); 130 131 TDOMElement(NewNode).SetAttribute('Name', UTF8Decode(Name)); 131 TDOMElement(NewNode).SetAttribute('Type', 'File');132 132 AppendChild(NewNode); 133 133 end; … … 171 171 172 172 procedure TProjectFile.SaveToXMLNode(Node: TDOMNode); 173 var 174 NewNode: TDOMNode; 173 175 begin 174 176 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; 175 182 Save; 176 183 end; … … 235 242 Clear; 236 243 RootDir := ExtractFileDir(FileName) + '/'; 244 //NewNode := Doc.DocumentElement.FindNode('Files'); 237 245 Name := ExtractFileName(FileName); 238 246 Name := Copy(Name, 1, Length(Name) - Length(ExtractFileExt(FileName))); … … 240 248 ReadXMLFile(Doc, UTF8Decode(FileName)); 241 249 242 NewNode := Doc.DocumentElement.FindNode('F iles');250 NewNode := Doc.DocumentElement.FindNode('Folder'); 243 251 if Assigned(NewNode) then 244 252 LoadFromXMLNode(NewNode); … … 257 265 Child := Node.FirstChild; 258 266 while Assigned(Child) do begin 259 NodeType := TDOMElement(Child).GetAttribute('Type'); 260 if NodeType = 'Folder' then 267 if Child.NodeName = 'Folder' then 261 268 ProjectNode := TProjectGroup.Create 262 else if NodeType = 'File' then269 else if Child.NodeName = 'File' then 263 270 ProjectNode := TProjectFile.Create 264 271 else ProjectNode := nil; … … 287 294 AppendChild(RootNode); 288 295 with RootNode do begin 289 NewNode := OwnerDocument.CreateElement('Files');290 SaveToXMLNode(NewNode);291 296 end; 297 SaveToXMLNode(RootNode); 292 298 WriteXMLFile(Doc, UTF8Decode(FileName)); 293 299 finally
Note:
See TracChangeset
for help on using the changeset viewer.