Author Topic: wxSmith show a untitled item under the root resource tree  (Read 2393 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
wxSmith show a untitled item under the root resource tree
« on: March 13, 2023, 07:01:47 am »
Hi, I see a node named "untitled" in the wxSmith's item tree, see the attachment image, any ideas?

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: wxSmith show a untitled item under the root resource tree
« Reply #1 on: March 14, 2023, 12:20:18 am »
You probably have a left over resource in the project file? Can you look at it with a text editor?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wxSmith show a untitled item under the root resource tree
« Reply #2 on: March 14, 2023, 12:49:51 am »
I think I have found the reason.

Every C::B cbp(even it is a console project) will have a node shown in the wxSmith's item tree. The untitled node is from the "Clangd_client plugin", because it will create a dummy project.  ;)

I think we have to fix it.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: wxSmith show a untitled item under the root resource tree
« Reply #3 on: March 14, 2023, 02:58:14 am »
I think I have found the reason.

Every C::B cbp(even it is a console project) will have a node shown in the wxSmith's item tree. The untitled node is from the "Clangd_client plugin", because it will create a dummy project.  ;)

I think we have to fix it.
Yes, clangd_client has a hidden "proxy" project.

But I don't understand what this has to do with wxSmith, or why it would show up in a wxSmith tree.

Can you explain this to me?
Can you tell me how to show it for myself.
Maybe I can "hide" it again.

Unfortunately, we need this hidden project in order for clangd_client to add "unowned" files that do not have a parent project.
Else we can't send them to clangd for parsing/analysis.

« Last Edit: March 14, 2023, 03:11:03 am by Pecan »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wxSmith show a untitled item under the root resource tree
« Reply #4 on: March 14, 2023, 05:04:51 am »
If you open the C::B without opening any cbp files, you will see wxSmith show a untitled node.

I think what wxSmith does is try to add one node for each cbp, whether the cbp is hidden or not.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: wxSmith show a untitled item under the root resource tree
« Reply #5 on: March 15, 2023, 12:40:49 am »
Fixed in Head 13233

Clangd_Client v1.2.64 23/03/14
Fix "untitled" project appearing in wxSmith resources by removing <Extensions> from the ~ProxyProject~.cbp thereby avoiding wxSmith's LoadHook invocation.

wxSmith is not removing closed projects from it's wxsResources.

Clangd_client creates and closes the ~ProxyProject~, but wxSmith created an entry in its wxsResource container during its Project Load Hook, but does not delete it during its OnProjectClose event.

Since clangd_client doesn't use <Extensions> anyway, it was easier to solve the problem by modifying the ~ProxyProject~.cbp.

wxSmith should actually remove closed projects from it's wxsResource containers during the OnProjectClose event. However, wxSmith looks too complex for me to mangle.
« Last Edit: March 15, 2023, 12:50:28 am by Pecan »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wxSmith show a untitled item under the root resource tree
« Reply #6 on: March 15, 2023, 01:47:58 am »
Hi, Pecan, many thanks for the fix. I will try to build the latest C::B svn trunk to test it.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wxSmith show a untitled item under the root resource tree
« Reply #7 on: March 15, 2023, 02:00:39 am »
Hi, Pecan, many thanks for the fix. I will try to build the latest C::B svn trunk to test it.

I can confirm the bug is fixed now, thanks.

About the wxSmith, It also looks a bit complex to me, hope some day, I have time to read those code again. Maybe, we can use the chapGPT like AI tool to read the code, and it can explain the code structure to me.  :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.