Adding new files to background parser

Milian Wolff mail at
Mon Jul 26 19:12:42 UTC 2010

On Monday, 26. July 2010 20:50:53 Andreas Pakulat wrote:
> On 14.07.10 18:45:01, Milian Wolff wrote:
> > Hey there,
> > 
> > currently new files added to a project (cp, git checkout, ...) are not
> > added to the background parser, even when the user wants the whole
> > project to get parsed.
> > 
> > The setting would be:
> >     KDevelop::ICore::self()->activeSession()->config()->group( "Project
> > 
> > Manager" );
> > 
> >     return group.readEntry( "Parse All Project Sources"
> > 
> > But that is currently only used privately in ProjectController (note:
> > _not_ IProjectController). Is there another way to get that setting, or
> > should I make that setting public from the ProjectController?
> What do you mean with "make it public"? If its just about a
> boolean-getter that reads from kconfig, sure makes complete sense.


> > Then I could add it to the GenericManager, not sure about CmakeManager.
> You mean you could schedule a parse-job from the manager when a file is
> added?


> > Actually listening to the ProjectModels signals inside the background
> > parser directly and honoring the setting would of course be even better,
> > but I wonder when the sig/slot connection should be setup. Right now
> > there is this
> > 
> >         KJob* parseProjectJob = new KDevelop::ParseProjectJob(project);
> > 
> > setup in the ProjectController, which would of course lead to doubled
> > adds (I know the background parser can cope with that, but it's just
> > unneeded overhead, isn't it?).
> I don't see how that would work as the job is not persistent. What
> happens if I do a git pull 4 hours after opening the project... Or do
> you mean make the projectcontroller create a new such job every time the
> filesAdded signal is emitted? That seems like a lot of waste as even
> just iterating the files (from the parser) to check wether parsing is
> necessary takes 'ages' :)

Not a ParseProjectJob of course, "only" a normal parsejob for each added / 
removed file. I thought by using the signals I could prevent doubled code in 
all the project managers.

> IMHO scheduling a new parse-job from the manager when a file is
> added is totally fine. Bonus points if (in case of removal) it
> first fetches all files using the removed file (i.e. #include'ing it)
> and scheduling them for removal too :)

If you answer the above question, I'm ok with adding it to the manager. But 
you surely mean "scheduling them for reparsing" right? :P
Milian Wolff
mail at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the KDevelop-devel mailing list