From: <jfu...@us...> - 2007-03-02 22:31:37
|
Revision: 11197 http://svn.sourceforge.net/jvcl/?rev=11197&view=rev Author: jfudickar Date: 2007-03-02 14:31:35 -0800 (Fri, 02 Mar 2007) Log Message: ----------- Mantis 0004016 :TJvCustomAppDBStorage.PathExistsInt fixed (Mantis #0004016) Modified Paths: -------------- trunk/jvcl/run/JvAppDBStorage.pas trunk/jvcl/run/JvAppIniStorage.pas Modified: trunk/jvcl/run/JvAppDBStorage.pas =================================================================== --- trunk/jvcl/run/JvAppDBStorage.pas 2007-03-02 22:09:09 UTC (rev 11196) +++ trunk/jvcl/run/JvAppDBStorage.pas 2007-03-02 22:31:35 UTC (rev 11197) @@ -139,7 +139,7 @@ uses JclMime, - JvJCLUtils, JvResources; + JvJCLUtils, JvResources, JclAnsiStrings; constructor TJvCustomAppDBStorage.Create(AOwner: TComponent); begin @@ -310,7 +310,7 @@ ListIsValue: Boolean): Boolean; begin { TODO -oJVCL -cTESTING : Is this correct implementation? } - Result := SectionExists(Path, True); + Result := SectionExists(StrEnsureNoPrefix(PathDelim, Path), True); end; procedure TJvCustomAppDBStorage.Notification(AComponent: TComponent; @@ -325,7 +325,7 @@ function TJvCustomAppDBStorage.PathExistsInt(const Path: string): Boolean; begin { TODO -oJVCL -cTESTING : Is this correct implementation? } - Result := SectionExists(Path, True); + Result := SectionExists(StrEnsureNoPrefix(PathDelim, Path), True); end; function TJvCustomAppDBStorage.ReadValue(const Section, Key: string): string; Modified: trunk/jvcl/run/JvAppIniStorage.pas =================================================================== --- trunk/jvcl/run/JvAppIniStorage.pas 2007-03-02 22:09:09 UTC (rev 11196) +++ trunk/jvcl/run/JvAppIniStorage.pas 2007-03-02 22:31:35 UTC (rev 11197) @@ -163,7 +163,8 @@ uses SysUtils, JvJCLUtils, // BinStrToBuf & BufToBinStr - JvVCL5Utils, JvConsts, JvResources; // JvConsts or PathDelim under D5 and BCB5 + JvVCL5Utils, JvConsts, JvResources, + JclAnsiStrings; // JvConsts or PathDelim under D5 and BCB5 const cNullDigit = '0'; @@ -645,24 +646,18 @@ FlushIfNeeded; end else - if IniFile.SectionExists(LSection + '\' + Key) then + if IniFile.SectionExists(LSection + PathDelim + Key) then begin - IniFile.EraseSection(LSection + '\' + Key); + IniFile.EraseSection(LSection + PathDelim + Key); FlushIfNeeded; end; end; end; function TJvCustomAppIniStorage.PathExistsInt(const Path: string): Boolean; -var - Section: string; begin ReloadIfNeeded; - if Copy(Path,1,1) = PathDelim then - Section := Copy(Path, 2, Length(Path)-1) - else - Section := Path; - Result := IniFile.SectionExists(Section); + Result := IniFile.SectionExists(StrEnsureNoPrefix(PathDelim, Path)); end; function TJvCustomAppIniStorage.IsFolderInt(const Path: string; ListIsValue: Boolean): Boolean; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |