Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

UI for project globs aka automatic source directories

(1/6) > >>

today i pushed (r13191) a UI for project globs aka automatic source directories.
This adds
+ an UI for the user to easy enter directories and specify if they should be added recursively and with file masks (found under the menu Project->Automatic source paths)
+ a logic based on wxFileSystemWatcher that watches the above added directories for file changes and adds and removes the file as they are added and removed from the file system
+ a rudimentary script binding

BEWARE: this changes behaviour of old file globs, that was only accessible when editing the project file directly.
The old implementation (loading the directories only on project load, and not adding them in the project file directly) made problems with code completion and compiler settings ecc...
I think this implementation is a lot better, but it changes the project file every time a file is added in the directory (as a makefile would).

i worked for this a while ago, obfuscated made some reviews and was ok with it, but because the wxFileSystemWatcher was not available on all platforms in wx2.8 this work was lost. Now that we are on wx3.0 a was thinking to add this to trunk.
Any comments are welcome.
thank you!

Miguel Gimenez:
I get this warnings/errors when trying to compile in MSW-32 bits:

--- Code: ---projectfile.h||In constructor 'ProjectFile::ProjectFile(cbProject*)':|
projectfile.h|237|warning: 'ProjectFile::project' will be initialized after [-Wreorder]|
projectfile.h|195|warning:   'GlobId ProjectFile::globId' [-Wreorder]|
projectfile.cpp|26|warning:   when initialized here [-Wreorder]|

projectmanagerui.o||In function `ZN16ProjectManagerUI13OnManageGlobsER14wxCommandEvent':|
C:\Codeblocks\src\src\projectmanagerui.cpp|1657|undefined reference to `ManageGlobsDlg::ManageGlobsDlg(cbProject*, wxWindow*, int, wxPoint const&, wxSize const&)'|
C:\Codeblocks\src\src\projectmanagerui.cpp|1657|undefined reference to `ManageGlobsDlg::~ManageGlobsDlg()'|
C:\Codeblocks\src\src\projectmanagerui.cpp|1657|undefined reference to `ManageGlobsDlg::~ManageGlobsDlg()'|

--- End code ---
The undefined references appear because you added the new files to all projects but CodeBlocks_wx32.cbp. I have attached a patch for this part.

Thank you! Fixed in trunk

I tried to understand how this "globs" work, how I could eventually use them, and how I can translate the few items.
Until now, no real success.
Could you give us some examples or better add them and a detailed description in the CB wiki (Then, I will be able to add this in the documentation).

Quick and dirty wiki article...
i do not know how to describe it better:


[0] Message Index

[#] Next page

Go to full version