View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004836 | JEDI VCL | 00 JVCL Components | public | 2009-06-28 09:52 | 2009-07-09 10:37 |
Reporter | tetardd | Assigned To | obones | ||
Priority | normal | Severity | tweak | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Product Version | 3.36 | ||||
Target Version | Fixed in Version | 3.38 | |||
Summary | 0004836: 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. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2009-06-28 09:52 | tetardd | New Issue | |
2009-06-28 13:21 | outchy | Issue cloned: 0004837 | |
2009-06-28 13:21 | outchy | Relationship added | related to 0004837 |
2009-06-28 13:24 | outchy | Note Added: 0015725 | |
2009-07-06 14:12 | obones | Status | new => acknowledged |
2009-07-09 10:37 | obones | Note Added: 0015798 | |
2009-07-09 10:37 | obones | Status | acknowledged => resolved |
2009-07-09 10:37 | obones | Fixed in Version | => Daily / SVN |
2009-07-09 10:37 | obones | Resolution | open => fixed |
2009-07-09 10:37 | obones | Assigned To | => obones |