Dinar 22 Posted March 15, 2019 (edited) You may also try to use Delphi Unit Dependency Scanner. View used units in "list" tab. This program, compiled from the sources, supporting export scanned results to csv file, where the first column will be the all units. I hope you know that csv file can be open with Microsoft Excel (WPS Spreadsheets, LibreOffice Calc, etc.), where columns can be filtered, that allow you to find unique cell contents in a column (just in case, although the exported list should be, in theory, already unique) Edited March 15, 2019 by Dinar Share this post Link to post
dummzeuch 1506 Posted March 17, 2019 @PeterPanettone Isn't GExperts -> Project Dependencies what you are looking for? The only shortcoming is that it does not list the indirect dependencies for the whole project, into which I am looking right now. If it's possible to be done easily, I will add that. 1 Share this post Link to post
dummzeuch 1506 Posted March 17, 2019 8 hours ago, dummzeuch said: The only shortcoming is that it does not list the indirect dependencies for the whole project, into which I am looking right now. If it's possible to be done easily, I will add that. Done. I even improved performance of the indirect list by a factor of about 5 to 10 (I didn't do any exact timing on the original code, so I don't know. But it now takes less than 2 seconds for the GExperts project where before it took more than 10.) Note to self: If the performance of some code is bad, check whether it stores and accesses data in the UI all the time. Remove this access and watch the performance skyrocket. Another note to self: TListView is one of the worst performing controls out there. If you want to improve performance further, use a TStringList or maybe even better a virtual string list. 1 Share this post Link to post
Attila Kovacs 629 Posted March 17, 2019 TListView.Items.BeginUpdate / EndUpdate? Share this post Link to post
jbg 239 Posted March 17, 2019 2 hours ago, dummzeuch said: Another note to self: TListView is one of the worst performing controls out there. If you want to improve performance further, use a TStringList or maybe even better a virtual string list. You can use TListView in a virtual mode then it is as fast as a VirtualStringTree. OwnerData = True OnData = ListView1Data procedure TForm6.Button1Click(Sender: TObject); begin ListView1.Items.Count := 100000000; end; procedure TForm1.ListView1Data(Sender: TObject; Item: TListItem); begin Item.Caption := IntToStr(Item.Index); end; 3 Share this post Link to post
dummzeuch 1506 Posted March 18, 2019 9 hours ago, Attila Kovacs said: TListView.Items.BeginUpdate / EndUpdate? Was already used, that was the first thing I checked. 1 Share this post Link to post
PeterPanettone 158 Posted March 18, 2019 17 hours ago, dummzeuch said: Done. Thomas, I've built #2590. But I don't see where I can display and/or export a merged list of all used units in the whole project. The list created by "Export Used Units..." is the same as before. BTW, is there somewhere a possibility to see the current version/release number in the IDE, because both the old and the new show the same version number: Share this post Link to post
dummzeuch 1506 Posted March 18, 2019 (edited) 1 hour ago, PeterPanettone said: Thomas, I've built #2590. But I don't see where I can display and/or export a merged list of all used units in the whole project. The list created by "Export Used Units..." is the same as before. That list already contained all used units, including those indirectly used. And the list for the project (root node in the tree) contains all units of the project. Edited March 18, 2019 by dummzeuch Share this post Link to post
PeterPanettone 158 Posted March 18, 2019 9 minutes ago, dummzeuch said: That list already contained all used units, including those indirectly used. Thomas, you are right. However, this is not a merged list without duplicates in the strict sense because in the following case ComCtrls is being listed twice: uPDFViewer,ComCtrls SkinDemoUtils,ComCtrls So, the exported list is certainly useful. But for my purpose, I need to remove the duplicates. Share this post Link to post
PeterPanettone 158 Posted March 18, 2019 (edited) 3 hours ago, dummzeuch said: And the list for the project (root node in the tree) contains all units of the project. Thomas, what do you mean by "contains all units of the project"? When I select the root node "GExpertsRS103.dproj" on the left side then only the GX_* project units are displayed in the "Unit Uses" tab on the right side: ... and no indirectly used units are displayed in this tab. Edited March 18, 2019 by PeterPanettone Share this post Link to post
dummzeuch 1506 Posted March 18, 2019 ... and then you switch to the "indirect dependencies" tab and ... ? Share this post Link to post
PeterPanettone 158 Posted March 18, 2019 (edited) 3 hours ago, dummzeuch said: ... and then you switch to the "indirect dependencies" tab and ... ? OK, I get it. But then, why I don't get indirect units in the same way if I select a directly used unit node in the left tree: In this case, even the "Unit Uses" tab does not show any used units in "ToolsApi".pas, although it has a uses clause: Edited March 18, 2019 by PeterPanettone Share this post Link to post
dummzeuch 1506 Posted March 19, 2019 Not a bug. ToolsApi.pas is not in the search path (only ToolsApi.dcu), so it isn't parsed. You can see that in the Unit Uses list of GX_About: There is no Location info for that unit because it cannot be found. OK, that means that the list of indirect depencencies is not complete, because it does not contain units that are only in the uses list of units that are not in the search path. Hm, not sure I like that. Share this post Link to post
dummzeuch 1506 Posted March 21, 2019 On 3/19/2019 at 9:43 AM, dummzeuch said: Not a bug. Still was a but. It didn't work for units in the project either. Share this post Link to post