Changeset 93 for trunk/UCore.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/UCore.pas

    r91 r93  
    3737    Optimizations: TOptimizations;
    3838    procedure Init;
    39     procedure LoadFromRegistry(Root: HKEY; Key: string);
    40     procedure SaveToRegistry(Root: HKEY; Key: string);
     39    procedure LoadFromRegistry(Context: TRegistryContext);
     40    procedure SaveToRegistry(Context: TRegistryContext);
    4141    property CurrentTarget: TTarget read FCurrentTarget write SetCurrentTarget;
    4242  end;
     
    8383  {$ENDIF}
    8484
    85   LoadFromRegistry(HKEY(ApplicationInfo.RegistryRoot), ApplicationInfo.RegistryKey);
     85  LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext);
    8686end;
    8787
    8888procedure TCore.DataModuleDestroy(Sender: TObject);
    8989begin
    90   SaveToRegistry(HKEY(ApplicationInfo.RegistryRoot), ApplicationInfo.RegistryKey);
     90  SaveToRegistry(Core.ApplicationInfo.GetRegistryContext);
    9191  FreeAndNil(Targets);
    9292  FreeAndNil(Project);
     
    9494end;
    9595
    96 procedure TCore.LoadFromRegistry(Root: HKEY; Key: string);
     96procedure TCore.LoadFromRegistry(Context: TRegistryContext);
    9797begin
    9898  with TRegistryEx.Create do
    9999  try
    100     RootKey := Root;
    101     OpenKey(Key, True);
     100    CurrentContext := Context;
    102101    OpenProjectOnStart := ReadBoolWithDefault('OpenProjectOnStart', True);
    103102    if ValueExists('LanguageCode') then
     
    113112    Free;
    114113  end;
    115   LastOpenedList.LoadFromRegistry(RegContext(Root, Key + '\' + RecentFilesRegKey));
    116   Targets.LoadFromRegistry(Root, Key);
    117   PersistentForm1.RegistryContext := RegContext(Root, Key);
     114  LastOpenedList.LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + RecentFilesRegKey));
     115  Targets.LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\Compiler'));
     116  PersistentForm1.RegistryContext := Context;
    118117end;
    119118
    120 procedure TCore.SaveToRegistry(Root: HKEY; Key: string);
     119procedure TCore.SaveToRegistry(Context: TRegistryContext);
    121120begin
    122   Targets.SaveToRegistry(Root, Key);
    123   LastOpenedList.SaveToRegistry(RegContext(Root, Key + '\' + RecentFilesRegKey));
     121  Targets.SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\Compiler'));
     122  LastOpenedList.SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + RecentFilesRegKey));
    124123  with TRegistryEx.Create do
    125124  try
    126     RootKey := Root;
    127     OpenKey(Key, True);
     125    CurrentContext := Context;
    128126    WriteBool('OpenProjectOnStart', OpenProjectOnStart);
    129127    WriteBool('DPIAuto', ScaleDPI1.AutoDetect);
Note: See TracChangeset for help on using the changeset viewer.