Hello all,
I'm developing a simple plugin which contains a file browser with which you can quickly filter on filenames containing a specific substring (handy for large projects with lots of files on lots of different places, I have it for Visual Studio and use it all the time). The file browser contains a suffix tree to perform the search on but in order to keep it up to date I need to listen to the cbEVT_PROJECT_* events. All seems to work well except for the cbEVT_PROJECT_FILE_ADDED. The event gets fired when I add an existing file to the project but not if I add a new file to the project using the file wizard.
After some research I came to the conclusion that adding an existing file uses ProjectManager::AddMultipleFilesToProject() which indeed fires the event but the wizard directly calls cbProject::AddFile() which does not fires such event. Maybe there is some good reason to have cbProject::AddFile() not fire the cbEVT_PROJECT_FILE_ADDED event but otherwise wouldn't it be better to have only cbProject::AddFile() fire this event (the actual place where the adding happens) and remove it from ProjectManager::AddMultipleFilesToProject(), etc? This way no such events can be missed any more and no "secondary" functions such as ProjectManager::AddMultipleFilesToProject() which use cbProject::AddFile() have to remember to to fire the event.