1
0
mirror of synced 2024-12-22 17:23:07 +01:00

Fixed: base key not applied correctly in registry settings

This commit is contained in:
Mark van Renswoude 2004-09-05 14:04:05 +00:00
parent 011897142c
commit 330ba47f5e
2 changed files with 11 additions and 9 deletions

View File

@ -206,10 +206,11 @@ begin
pDefine := FFactory.GetDefine(FSection, AName); pDefine := FFactory.GetDefine(FSection, AName);
if not InternalReadBool(AName, Result) then if not InternalReadBool(AName, Result) then
begin
if Assigned(pDefine) then if Assigned(pDefine) then
Result := pDefine.Value Result := pDefine.Value
else else
raise EX2SettingsUndefined.CreateFmt(RSUndefined, [AName]); raise EX2SettingsUndefined.CreateFmt(RSUndefined, [AName])
if Assigned(pDefine) then if Assigned(pDefine) then
begin begin
@ -218,6 +219,7 @@ begin
Result := vValue; Result := vValue;
end; end;
end; end;
end;
function TX2Settings.ReadBool(const AName: String; function TX2Settings.ReadBool(const AName: String;
const ADefault: Boolean): Boolean; const ADefault: Boolean): Boolean;

View File

@ -53,7 +53,7 @@ type
procedure DeleteValue(const AName: String); override; procedure DeleteValue(const AName: String); override;
public public
constructor CreateInit(const AFactory: TX2SettingsFactory; constructor CreateInit(const AFactory: TX2SettingsFactory;
const ASection: String; const AKey, ASection: String;
const ARoot: Cardinal); const ARoot: Cardinal);
destructor Destroy(); override; destructor Destroy(); override;
end; end;
@ -86,7 +86,7 @@ uses
========================================} ========================================}
function TX2RegistrySettingsFactory.GetSection; function TX2RegistrySettingsFactory.GetSection;
begin begin
Result := TX2RegistrySettings.CreateInit(Self, ASection, FRoot); Result := TX2RegistrySettings.CreateInit(Self, FKey, ASection, FRoot);
end; end;
@ -100,7 +100,7 @@ begin
FData := TRegistry.Create(); FData := TRegistry.Create();
FData.RootKey := ARoot; FData.RootKey := ARoot;
FKey := IncludeTrailingPathDelimiter(FKey) + FKey := IncludeTrailingPathDelimiter(AKey) +
StringReplace(ASection, '.', '\', [rfReplaceAll]); StringReplace(ASection, '.', '\', [rfReplaceAll]);
end; end;