Author Topic: empty target name when creating a project with assistant  (Read 178 times)

Offline LETARTARE

  • Regular
  • ***
  • Posts: 342
  • L'ami de l'homme.The friend of man.
empty target name when creating a project with assistant
« on: December 18, 2017, 04:58:52 pm »
When activating a project by hand a 'cbEVT_PROJECT_ACTIVATE' is generated, which is notified to the plugins.
If a plugin is sensitive to this event, then it can analyze the project and it active target.
In the case of the creation of a project by the assistant, the created project is also actived : but the name of the active target is empty ( the one recovered since the event ) !
I did not find the source of the problem.

I enclose a small generic plugin that captures this event and displays in the 'Code::Blocks' pane the result.

This plugin was created with : VISTA with cb-11246 (sdk=1.33.0), wx2.8.12, TDM-GCC 4.7.1 32 bits (unicode).

C::B  : svn11246, wxwidgets2.8,
1-Vista Business Pack 2:  TDM-GCC 4.7.1,   CB plugins : QtPregen-1.0
2-OpenSuse-42.3-Leap :  g++-4.8.5,
=> !! The messages are translated by GOOGLE !!

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2070
Re: empty target name when creating a project with assistant
« Reply #1 on: December 18, 2017, 08:28:44 pm »
After the Project_Activate event, another will occur for a new project.
It will have the target.

Manager::Get()->RegisterEventSink(cbEVT_PROJECT_NEW, new cbEventFunctor<genericplugin, CodeBlocksEvent>(this, &genericplugin::OnNewProject));



Offline LETARTARE

  • Regular
  • ***
  • Posts: 342
  • L'ami de l'homme.The friend of man.
Re: empty target name when creating a project with assistant
« Reply #2 on: December 19, 2017, 01:47:33 am »
Hello @Pecan,
thank you for this constructive response. I would never have found it alone !
Indeed, it is a curious way to proceed: send the event 'Activated' before the event 'Created'.
But there are surely more obscure reasons ...

Thanks again.
C::B  : svn11246, wxwidgets2.8,
1-Vista Business Pack 2:  TDM-GCC 4.7.1,   CB plugins : QtPregen-1.0
2-OpenSuse-42.3-Leap :  g++-4.8.5,
=> !! The messages are translated by GOOGLE !!