Changeset 136 for trunk/UCore.pas
- Timestamp:
- Mar 5, 2022, 4:14:27 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r135 r136 29 29 FCurrentTarget: TTarget; 30 30 StoredDimension: TControlDimension; 31 RecentFileRegistryContext: TRegistryContext; 31 32 procedure InitTargets; 32 33 procedure SetCurrentTarget(AValue: TTarget); … … 46 47 Optimizations: TOptimizations; 47 48 procedure Init; 49 procedure AddItemToLastOpenedList(FileName: string); 48 50 procedure LoadFromRegistry(Context: TRegistryContext); 49 51 procedure SaveToRegistry(Context: TRegistryContext); … … 69 71 70 72 { TCore } 73 74 procedure TCore.AddItemToLastOpenedList(FileName: string); 75 begin 76 with LastOpenedList do begin 77 LoadFromRegistry(RecentFileRegistryContext); 78 AddItem(FileName); 79 SaveToRegistry(RecentFileRegistryContext); 80 end; 81 end; 71 82 72 83 procedure TCore.DataModuleCreate(Sender: TObject); … … 91 102 StoredDimension := TControlDimension.Create; 92 103 InitTargets; 104 RecentFileRegistryContext := TRegistryContext.Create(ApplicationInfo.RegistryRoot, 105 ApplicationInfo.RegistryKey + '\' + RecentFilesRegKey); 93 106 LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext); 94 107 end; … … 149 162 Free; 150 163 end; 151 LastOpenedList.LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + RecentFilesRegKey));152 164 Targets.LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\Compiler')); 165 LastOpenedList.LoadFromRegistry(RecentFileRegistryContext); 153 166 PersistentForm1.RegistryContext := Context; 154 167 end; … … 157 170 begin 158 171 Targets.SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\Compiler')); 159 LastOpenedList.SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + RecentFilesRegKey));160 172 with TRegistryEx.Create do 161 173 try
Note:
See TracChangeset
for help on using the changeset viewer.