Changeset 19 for trunk/UProject.pas
- Timestamp:
- Apr 2, 2016, 10:01:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UProject.pas
r16 r19 24 24 Scans: TDriveScanList; 25 25 DriveInfo: TDriveInfo; 26 ScanProfile: TDriveScanProfile; 26 27 constructor Create; 27 28 destructor Destroy; override; … … 56 57 Scans := TDriveScanList.Create; 57 58 DriveInfo := TDriveInfo.Create; 59 ScanProfile := TDriveScanProfile.Create; 58 60 end; 59 61 60 62 destructor TProject.Destroy; 61 63 begin 64 FreeAndNil(ScanProfile); 62 65 FreeAndNil(DriveInfo); 63 66 FreeAndNil(Scans); … … 82 85 WriteString(RootNode, 'DrivePath', DriveInfo.Path); 83 86 WriteInt64(RootNode, 'DriveSize', DriveInfo.Size); 87 88 NewNode := OwnerDocument.CreateElement('ScanProfile'); 89 AppendChild(NewNode); 90 WriteInteger(NewNode, 'SectorStart', ScanProfile.SectorStart); 91 WriteInteger(NewNode, 'SectorEnd', ScanProfile.SectorEnd); 92 WriteInteger(NewNode, 'WritePattern', ScanProfile.WritePattern); 93 WriteInteger(NewNode, 'Mode', Integer(ScanProfile.Mode)); 84 94 85 95 NewNode := OwnerDocument.CreateElement('Scans'); … … 111 121 DriveInfo.SectorSize := ReadInteger(RootNode, 'SectorSize', 4096); 112 122 DriveInfo.SectorCount := ReadInteger(RootNode, 'SectorCount', 0); 123 ScanProfile.SectorCount := DriveInfo.SectorCount; 113 124 DriveInfo.Model := ReadString(RootNode, 'DriveName', ''); 114 125 DriveInfo.Path := ReadString(RootNode, 'DrivePath', ''); 115 126 DriveInfo.Size := ReadInt64(RootNode, 'DriveSize', 0); 127 128 NewNode := FindNode('ScanProfile'); 129 if Assigned(NewNode) then begin 130 ScanProfile.SectorStart := ReadInteger(NewNode, 'SectorStart', 0); 131 ScanProfile.SectorEnd := ReadInteger(NewNode, 'SectorEnd', ScanProfile.SectorCount - 1); 132 ScanProfile.WritePattern := ReadInteger(NewNode, 'WritePattern', 0); 133 ScanProfile.Mode := TRunMode(ReadInteger(NewNode, 'Mode', 0)); 134 end; 116 135 117 136 NewNode := FindNode('Scans');
Note:
See TracChangeset
for help on using the changeset viewer.