News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

empty target name when creating a project with assistant

Started by LETARTARE, December 18, 2017, 04:58:52 PM

Previous topic - Next topic

LETARTARE

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).

CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

Pecan

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));



LETARTARE

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.
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'