Changeset 93 for trunk/UTarget.pas


Ignore:
Timestamp:
Jul 20, 2018, 10:25:06 AM (6 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        66compiled
        77heaptrclog.trc
         8LazFuck.dbg
  • trunk/UTarget.pas

    r88 r93  
    120120    procedure StepOut; virtual;
    121121    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;
    124124    property State: TRunState read FState write SetState;
    125125    property SourceCode: string write SetSourceCode;
     
    134134
    135135  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);
    138138    function FindByName(Name: string): TTarget;
    139139    procedure LoadToMenuItem(MenuItem: TMenuItem; Action: TNotifyEvent;
     
    271271{ TTargetList }
    272272
    273 procedure TTargetList.LoadFromRegistry(Root: HKEY; Key: string);
     273procedure TTargetList.LoadFromRegistry(Context: TRegistryContext);
    274274var
    275275  I: Integer;
     
    277277  with TRegistryEx.Create do
    278278  try
    279     RootKey := Root;
    280     OpenKey(Key + '\Compiler', True);
     279    CurrentContext := Context;
    281280    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));
    283282  finally
    284283    Free;
     
    286285end;
    287286
    288 procedure TTargetList.SaveToRegistry(Root: HKEY; Key: string);
     287procedure TTargetList.SaveToRegistry(Context: TRegistryContext);
    289288var
    290289  I: Integer;
     
    292291  with TRegistryEx.Create do
    293292  try
    294     RootKey := Root;
    295     OpenKey(Key + '\Compiler', True);
     293    CurrentContext := Context;
    296294    for I := 0 to Count - 1 do
    297295    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));
    299297  finally
    300298    Free;
     
    507505end;
    508506
    509 procedure TTarget.LoadFromRegistry(Root: HKEY; Key: string);
     507procedure TTarget.LoadFromRegistry(Context: TRegistryContext);
    510508begin
    511509  with TRegistryEx.Create do
    512510  try
    513     RootKey := Root;
    514     OpenKey(Key + '\' + Name, True);
     511    CurrentContext := Context;
    515512    CompilerPath := ReadStringWithDefault('CompilerPath', CompilerPath);
    516513    ExecutorPath := ReadStringWithDefault('ExecutorPath', ExecutorPath);
     
    520517end;
    521518
    522 procedure TTarget.SaveToRegistry(Root: HKEY; Key: string);
     519procedure TTarget.SaveToRegistry(Context: TRegistryContext);
    523520begin
    524521  with TRegistryEx.Create do
    525522  try
    526     RootKey := Root;
    527     OpenKey(Key + '\' + Name, True);
     523    CurrentContext := Context;
    528524    if CompilerPath <> '' then WriteString('CompilerPath', CompilerPath)
    529525      else DeleteValue('CompilerPath');
Note: See TracChangeset for help on using the changeset viewer.