int ProjectManager::AddMultipleFilesToProject(const wxArrayString& filelist, cbProject* project, int target)
{
if (!project)
project = GetActiveProject();
wxArrayInt targets;
targets.Add(target);
if (AddMultipleFilesToProject(filelist, project, targets) == 1)
return targets[0];
return -1;
}
The documentation says, that in this function, if the parameter target == -1 then the user gets asked for the targets to add...
Now, AddMultipleFilesToProject calls DoAddFiles
nt ProjectManager::DoAddFileToProject(const wxString& filename, cbProject* project, wxArrayInt& targets)
{
if (!project)
return 0;
if (!SetupTargets(targets, project, m_ui))
return 0;
And do add files calls setupTargets
Setup targets checks if the targets array is empty and if so, asks the user for the targets...
In our case the array is not empty, but filled with -1 so the documentation is wrong
bool SetupTargets(wxArrayInt &targets, cbProject *project, cbProjectManagerUI *ui)
{
cbAssert(project);
cbAssert(ui);
// do we have to ask for target?
if (targets.GetCount() == 0)
{
Or am i missing something?