Gathering the set of files-to-watch

David Nolden zwabel at googlemail.com
Sun Jun 13 09:01:27 UTC 2010


I'm not at the computer right now, but in ParsingEnvironmentFile there
should be a member holding all recursive dependencies of a file as, which is
used when checking whether an update is required and for other occasions
(might also be in TopDUContext, "recursiveImports" or something like that).

Am 13.06.2010 10:50 schrieb "Esben Mose Hansen" <kde at mosehansen.dk>:

On Saturday 12 June 2010 21:39:34 David Nolden wrote:
> My next item on the list is getting and watc...
I am working on getting the included/imported files watched as well. I have
worked out this little snippet for getting imports:

   TopDUContext* context = DUChainUtils::standardContextForUrl(url);
   if (context) {
       QVector<DUContext::Import> imports = context-
>importedParentContexts();
       Q_FOREACH(DUContext::Import import, imports) {
           qDebug() << "indexed url for import: " <<
import.indexedContext().indexedTopContext().url().str();
       }
   } else {
       qDebug() << "No context for url";
   }

Is that the right way to do it? Of course, I would need to update the list
every time the file is parsed, and I think I would need to reparse any new
files in that list (otherwise, I cannot see how to avoid a race where the
file
is changed after passing but before the import is reported to the watching
mechanism).

The above needs to be done recursively: is there a smarter way to go about
this?

--

Kind regards, Esben

-- 
KDevelop-devel mailing list
KDevelop-devel at kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100613/debaacae/attachment.html>


More information about the KDevelop-devel mailing list