View Issue Details

IDProjectCategoryView StatusLast Update
0004837JEDI Code LibraryJclFileUtilspublic2009-07-14 14:33
ReporteroutchyAssigned Tooutchy 
PrioritynormalSeveritytweakReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionVersion 1.105 
Target VersionFixed in Version 
Summary0004837: Too many GetTempPath encapsulations
DescriptionThe JclFileUtils has a function called PathGetTempPath that encapsulates the Windows API GetTempPath function. Very useful.

However, doing a text search in all the Jedi VCL code, there are (too) many other encapsulations of the GetTempPath function, i.e up to 15 duplicates of PathGetTempPath (see list in additional info). This makes the code bloated and all the units needing a temporary path should simply use PathGetTempPath.

Additional InformationHere are all the instances of GetTempPath being used:
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\jcl\source\common\JclFileUtils.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\jcl\source\common\JclFileUtils.pas(2375): Result := Path.GetTempPath;
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\jcl\source\common\JclFileUtils.pas(2382): BufSize := Windows.GetTempPath(0, nil);
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\jcl\source\common\JclFileUtils.pas(2385): Windows.GetTempPath(BufSize, PChar(Result));
Found 'GetTempPath' 3 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\jcl\source\common\JclSysInfo.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\jcl\source\common\JclSysInfo.pas(1755): Result := Path.GetTempPath;
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\jcl\source\common\JclSysInfo.pas(1762): Required := GetTempPath(0, nil);
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\jcl\source\common\JclSysInfo.pas(1766): GetTempPath(Required, PChar(Result));
Found 'GetTempPath' 3 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\source\common\JclFileUtils.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\source\common\JclFileUtils.pas(2761): Result := Path.GetTempPath;
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\source\common\JclFileUtils.pas(2768): BufSize := Windows.GetTempPath(0, nil);
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\source\common\JclFileUtils.pas(2771): Windows.GetTempPath(BufSize, PChar(Result));
Found 'GetTempPath' 3 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\source\common\JclSysInfo.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\source\common\JclSysInfo.pas(1784): Result := Path.GetTempPath;
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\source\common\JclSysInfo.pas(1791): Required := GetTempPath(0, nil);
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jcl\source\common\JclSysInfo.pas(1795): GetTempPath(Required, PChar(Result));
Found 'GetTempPath' 3 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvBreatheSkin.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvBreatheSkin.pas(680): GetTempPath(255, buf);
Found 'GetTempPath' 1 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvDirectories.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvDirectories.pas(44): function GetTempPath: string;
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvDirectories.pas(56): property TempPath: string read GetTempPath write FDummy stored False;
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvDirectories.pas(133): function TJvDirectories.GetTempPath: string;
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvDirectories.pas(137): Windows.GetTempPath(SizeOf(Buffer), Buffer);
Found 'GetTempPath' 4 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvFileUtil.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvFileUtil.pas(591): SetString(Result, Buffer, GetTempPath(SizeOf(Buffer), Buffer));
Found 'GetTempPath' 1 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvUtils.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvUtils.pas(539): TempDir[GetTempPath(260, TempDir)] := #0;
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvUtils.pas(573): TempDir[GetTempPath(260, TempDir)] := #0;
Found 'GetTempPath' 2 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvVCLUtils.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\archive\JvVCLUtils.pas(2307): OSCheck(GetTempPath(MAX_PATH, Path) <> 0);
Found 'GetTempPath' 1 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\devtools\InstallerTests\DelphiPkgInstaller\Uninstall\Main.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\devtools\InstallerTests\DelphiPkgInstaller\Uninstall\Main.pas(198): SetLength(Result, GetTempPath(Length(Result), PChar(Result)));
Found 'GetTempPath' 1 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\examples\JvXMLDatabase\Sources\ClassUrlParser.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\examples\JvXMLDatabase\Sources\ClassUrlParser.pas(93): GetTempPath(MAX_PATH, Buf);
Found 'GetTempPath' 1 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\run\JvgExport.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\run\JvgExport.pas(110): GetTempPath(SizeOf(Buffer), Buffer);
Found 'GetTempPath' 1 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\run\JvJCLUtils.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\run\JvJCLUtils.pas(6814): Result := Path.GetTempPath;
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\run\JvJCLUtils.pas(6821): TempDir[GetTempPath(260, TempDir)] := #0;
Found 'GetTempPath' 2 time(s).
----------------------------------------
Find 'GetTempPath' in 'C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\run\JvJVCLUtils.pas':
C:\Program Files\BDS\6.0\Added Libraries\Jedi VCL\jvcl\run\JvJVCLUtils.pas(2711): OSCheck(GetTempPath(MAX_PATH, Path) <> 0);
Found 'GetTempPath' 1 time(s).
Search complete, found 'GetTempPath' 27 time(s). (14 file(s)).
TagsNo tags attached.
Fixed in GIT commit
Fixed in SVN revision2858
IDE versionRAD Studio 2007

Relationships

related to 0004836 resolvedobones JEDI VCL Too many GetTempPath encapsulations 

Activities

outchy

2009-07-14 14:33

administrator   ~0015853

occurrence in JclSysInfo.pas is removed in revision 2858.

Issue History

Date Modified Username Field Change
2009-06-28 13:21 outchy New Issue
2009-06-28 13:21 outchy Issue generated from: 0004836
2009-06-28 13:21 outchy Relationship added related to 0004836
2009-06-28 13:22 outchy Project JEDI VCL => JEDI Code Library
2009-06-28 13:23 outchy IDE version => RAD Studio 2007
2009-06-28 13:23 outchy Category 00 JVCL Components => JclFileUtils
2009-06-28 13:23 outchy Product Version 3.36 => Version 1.105
2009-07-14 14:33 outchy Fixed in revision => 2858
2009-07-14 14:33 outchy Note Added: 0015853
2009-07-14 14:33 outchy Status new => resolved
2009-07-14 14:33 outchy Fixed in Version => Version 2.0 (Subversion repository)
2009-07-14 14:33 outchy Resolution open => fixed
2009-07-14 14:33 outchy Assigned To => outchy