Changeset 93 for trunk/UTarget.pas
- Timestamp:
- Jul 20, 2018, 10:25:06 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 6 6 compiled 7 7 heaptrclog.trc 8 LazFuck.dbg
-
- Property svn:ignore
-
trunk/UTarget.pas
r88 r93 120 120 procedure StepOut; virtual; 121 121 procedure RunToCursor(Pos: Integer); virtual; 122 procedure LoadFromRegistry( Root: HKEY; Key: string); virtual;123 procedure SaveToRegistry( Root: HKEY; Key: string); virtual;122 procedure LoadFromRegistry(Context: TRegistryContext); virtual; 123 procedure SaveToRegistry(Context: TRegistryContext); virtual; 124 124 property State: TRunState read FState write SetState; 125 125 property SourceCode: string write SetSourceCode; … … 134 134 135 135 TTargetList = class(TListObject) 136 procedure LoadFromRegistry( Root: HKEY; Key: string);137 procedure SaveToRegistry( Root: HKEY; Key: string);136 procedure LoadFromRegistry(Context: TRegistryContext); 137 procedure SaveToRegistry(Context: TRegistryContext); 138 138 function FindByName(Name: string): TTarget; 139 139 procedure LoadToMenuItem(MenuItem: TMenuItem; Action: TNotifyEvent; … … 271 271 { TTargetList } 272 272 273 procedure TTargetList.LoadFromRegistry( Root: HKEY; Key: string);273 procedure TTargetList.LoadFromRegistry(Context: TRegistryContext); 274 274 var 275 275 I: Integer; … … 277 277 with TRegistryEx.Create do 278 278 try 279 RootKey := Root; 280 OpenKey(Key + '\Compiler', True); 279 CurrentContext := Context; 281 280 for I := 0 to Count - 1 do 282 TTarget(Items[I]).LoadFromRegistry( Root, Key + '\Compiler');281 TTarget(Items[I]).LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + TTarget(Items[I]).Name)); 283 282 finally 284 283 Free; … … 286 285 end; 287 286 288 procedure TTargetList.SaveToRegistry( Root: HKEY; Key: string);287 procedure TTargetList.SaveToRegistry(Context: TRegistryContext); 289 288 var 290 289 I: Integer; … … 292 291 with TRegistryEx.Create do 293 292 try 294 RootKey := Root; 295 OpenKey(Key + '\Compiler', True); 293 CurrentContext := Context; 296 294 for I := 0 to Count - 1 do 297 295 with TTarget(Items[I]) do 298 TTarget(Items[I]).SaveToRegistry( Root, Key + '\Compiler');296 TTarget(Items[I]).SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + TTarget(Items[I]).Name)); 299 297 finally 300 298 Free; … … 507 505 end; 508 506 509 procedure TTarget.LoadFromRegistry( Root: HKEY; Key: string);507 procedure TTarget.LoadFromRegistry(Context: TRegistryContext); 510 508 begin 511 509 with TRegistryEx.Create do 512 510 try 513 RootKey := Root; 514 OpenKey(Key + '\' + Name, True); 511 CurrentContext := Context; 515 512 CompilerPath := ReadStringWithDefault('CompilerPath', CompilerPath); 516 513 ExecutorPath := ReadStringWithDefault('ExecutorPath', ExecutorPath); … … 520 517 end; 521 518 522 procedure TTarget.SaveToRegistry( Root: HKEY; Key: string);519 procedure TTarget.SaveToRegistry(Context: TRegistryContext); 523 520 begin 524 521 with TRegistryEx.Create do 525 522 try 526 RootKey := Root; 527 OpenKey(Key + '\' + Name, True); 523 CurrentContext := Context; 528 524 if CompilerPath <> '' then WriteString('CompilerPath', CompilerPath) 529 525 else DeleteValue('CompilerPath');
Note:
See TracChangeset
for help on using the changeset viewer.