View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004837 | JEDI Code Library | JclFileUtils | public | 2009-06-28 13:21 | 2009-07-14 14:33 |
Reporter | outchy | Assigned To | outchy | ||
Priority | normal | Severity | tweak | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Product Version | Version 1.105 | ||||
Target Version | Fixed in Version | ||||
Summary | 0004837: Too many GetTempPath encapsulations | ||||
Description | The 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 Information | Here 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)). | ||||
Tags | No tags attached. | ||||
Fixed in GIT commit | |||||
Fixed in SVN revision | 2858 | ||||
IDE version | RAD Studio 2007 | ||||
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 |