Jump to content
PeterPanettone

List of all uses clause items in the whole project

Recommended Posts

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)

CEC05FC1-8ACB-4671-B53E-17166F68F337.png

Edited by Dinar

Share this post


Link to post

@PeterPanettone Isn't GExperts -> Project Dependencies what you are looking for?

GEXperts-Project-Dependencies.thumb.png.4a01516f129f4a10b06b11f23377d723.pngThe 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.

  • Like 1

Share this post


Link to post
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.

  • Like 1

Share this post


Link to post
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;


 

  • Thanks 4

Share this post


Link to post
9 hours ago, Attila Kovacs said:

TListView.Items.BeginUpdate / EndUpdate?

Was already used, that was the first thing I checked.

  • Like 1

Share this post


Link to post
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:

 

image.png.840cfdf202a3439e58f9f9bfff8aaad6.png

 

image.png.e26b4c741b0b4ca44f410bffc4dcc90a.png

 

 

Share this post


Link to post
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 by dummzeuch

Share this post


Link to post
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×