IProjectFileManager::import and parse

Andras Mantia amantia at kde.org
Fri Jun 22 06:16:33 UTC 2007


On Friday 22 June 2007, Andreas Pakulat wrote:
> > 1) Why shouldn't parse be the recursive method instead of the
> > ImportProjectJob::start() ?
>
> Because then each manager would have to do it and we can't decide in
> the platform how to handle project parsing, i.e. if we want to do
> everything in a separate thread, or we want to do each parse() in a
> thread or we want to call processEvents() after each parse() or
> whatever.

I don't see why is it different to run one "big" parse in a separate 
thread as opposed to several small parses in separate threads.

> Uhm, you can easily create the whole structure in your item and then
> just use the given item to return the sub-folders. I don't see why
> you'd need to reparse every time.
Sure, but in that case the same information (the layout of files and 
folders of a project) would be stored twice:
- in my data structure which is read somewhere in the import phase and 
used as a base for "parsing"
- in the Project*Item objects

>
> > 2) Is there a real need to "parse" for anything else than the top
> > level item? Of course now it is, due to the code in
> > ImportProjectJob::start, but I don't see any other need for it. The
> > project file manager plugin should read only once the project file:
> > when the project is loaded. If there is a need for a list of
> > files/folders under one folder, this list should (and can) be
> > obtained from the Project*Item tree structure.
>
> Uhm, this is also the interface for the buildsystem managers and
> these have multiple files in multiple dirs to parse.

Sure, most projects have multiple files and multiple directories. ;) But 
this still doesn't answer the question is parse can be called later on 
as well, or it is only used to initially read the project. It is 
important if I do the above "caching" of the project layout, do I need 
to keep it until the project is cached?

> > 3) Why is there the "import" and "parse" separation, if parse could
> > also create the top level item as well?
>
> I'm not sure, but one reason could be that they actually do different
> things.

Matt answered what should import do, and that makes things clear. 
I'm not too happy with the idea, but I understand this is needed to work 
with the current ImportProjectJob.

Andras
-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20070622/f321fd99/attachment.sig>


More information about the KDevelop-devel mailing list