IProjectFileManager::import and parse
Andras Mantia
amantia at kde.org
Thu Jun 21 23:13:22 UTC 2007
Hi,
I'd like some extra information about the above methods as the docs,
well, they are not very detailed. ;)
As I understand import shouldn't do anything else but return the
toplevel project item, usually the toplevel folder of the project.
As *I* understood, parse would then parse the *whole* project and return
a list with the folders belonging to the project, and *only* folders
(probably not the files, as they are anyway children of folder items).
Well, the main problem is that the shell has a different idea of parse
than I do, as it works like this:
- call parse, get a list of directories
- call parse for each of the directories from the above list
- repeat this until no directories are found
So this is a recursive call.
The documentation for parse is: "This method initialize the model item."
So the questions:
1) Why shouldn't parse be the recursive method instead of the
ImportProjectJob::start() ? The problem with the recursiveness in the
upper level is that sometimes a project file can contain just some urls
to the files belonging to the project (somewhat similar to KDevelop's
custom project). In such a case it is really hard to provide first the
top-level directories, then the ones one level below (separately for
each top-level directory), and so on. This would require multiple
parsing of the project file. For such cases its much simple to parse
the project file once and create *every* Project*Item there.
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.
3) Why is there the "import" and "parse" separation, if parse could also
create the top level item as well?
Of course 1-2-3 depend on each other. ;)
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/80cb6113/attachment.sig>
More information about the KDevelop-devel
mailing list