This is an automatically generated e-mail. To reply, visit:

Review request for Kile.
By Eugene Shalygin.

Summary (updated)

Improve dependency tracking for Kile

Description (updated)

Kile tracks depepndencies for build and for project view widget using project items only. It is common to have several bibliiographical databases and connect them to many projects. Same partially applies for different text fragments, like tables, for instance. Current Kile implementation demands user to add all these fragments to the project manually. However, it is not hard to detect all such dependecies automatically (by parsing source files or .aux files) and give user a list for selection and check-in. So, one of the goals of this patch is to make it possible and simple. Aslo it might have sence to track dependencies for so to say "external" items. For instance, one can have many \addbibresource commands but does not want to add these files to the projects. For example. they are shared and stored in a separate repository.

Another goal is to fix parsing of multi-level includes, that does not work, generally, in Kile right now. Here is an example:

Since include path is always related to the master document, it is impossible to parse subdir\file1.tex correctly before master.tex. If we do not know how that file was included, we can not deduce a full path to its dependencies (subdir\file2 here). Thus, if subdir\file1.tex is either opened in the editor or placed in the project file before master.tex, parsing does not work.

This patch does not achive all of above mentioned goals, but it became long enough already. It is at the point where it does not break current functionality (I hope :) ), but sets a framework for the future. As an attraction, it fixes the parsing  problem :)
Idea: split KileProjectItem class into a class that represents a dependency item (either external or part of the project) and a class that stores project item settings. The DependencyItem class partially implements the Composite pattern.
Further steps: add actions to context menu in project view for including/excluding nodes from the project. Implement bibliography and other dependencies chacking via DependencyItem trees. Improve actual dependencies tracking by parsing aux files (where all conditiona are resolved already by LaTeX).
Questions and problems: 
1. It would be nice to have a single enum that describes the file type (source, image, ..). Now there are two in KileDocument and in KileProjectItem. Why? Can I merge them?  
2. It would be nice to have a possibility to submit items for the parsing in batch and with priority. Right now the project tree is rebuilding after every parsed item, which is not needed. Are there any objections for this?

Testing (updated)

I'm working with this for a some time

Diffs (updated)

  • src/kile.cpp (37f46fe)
  • src/kiledocmanager.h (229968e)
  • src/kiledocmanager.cpp (825a845)
  • src/kileinfo.cpp (419c5b9)
  • src/kileproject.h (1dd0c9b)
  • src/kileproject.cpp (33f6962)
  • src/parser/parsermanager.h (3daaa99)
  • src/parser/parsermanager.cpp (0033741)
  • src/parser/parserthread.h (c8206f0)
  • src/parser/parserthread.cpp (9a01368)
  • src/widgets/projectview.h (97b6f29)
  • src/widgets/projectview.cpp (d59c1fc)

View Diff