GenericProjectManager improvements

Andreas Pakulat apaku at gmx.de
Fri Oct 3 21:44:37 UTC 2008


On 03.10.08 23:25:06, Niko Sams wrote:
> On Fri, Oct 3, 2008 at 10:54 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> > On 03.10.08 22:31:14, Niko Sams wrote:
> >> 1. detect filesystem changes (new files, files removed)
> > Make sure to not watch about too many things, this can slow down things and
> > it can lead to some watchings not done at all, because at least one
> > implementation of kdirwatcher (inotify) has a maximum number of watchable
> > files/dirs.
> Can't I watch a folder recursively? WatchMode::WatchSubDirs

I don't know, but I suspect that doesn't change anything because KDirWatch
will simply add inotify-watches for all of the subdirs.

> >> 2. refresh
> >> Where should I implement this? Other ProjectManagers need such a functionality
> >> too - if they display files in the filesystem.
> >
> > What do you mean with "refresh"? We already have support to reload the
> > model of a project. We of course need to make this more fine-grained. In
> > theory its possible to simply delete an item of the project tree and re-add
> > a new one.
> >
> >> And how can I add a refresh action to the context-menu? I think this would make
> >> sense for other ProjectManagers too.
> >
> > Well, CMake support already has some reloading support, because it has
> > language support and hence reloads when one edits a CMakeLists.txt.
> Yes - but it just detects changes in CMakeList.txt. If a .h file is
> added it doesn't show up.

Right.

> > Adding an action to a context menu can be done by simply implementing the
> > contextMenuExtension method in your plugin. I think the project group would
> > be good for this action.
> which plugin? ProjectManagerView?

Ah, right. Didn't think this to the end. You can add an action to
projectmanagerviewplugin.cpp in contextMenuExtension. If you want reload to
work on a fine-grained level we need to API for that - probably on
IProjectFileManager. When that is in place we can have a refresh action in
the context menu which fetches the manager plugin for the project and calls
the reload() function.

Andreas

-- 
You will be imprisoned for contributing your time and skill to a bank robbery.




More information about the KDevelop-devel mailing list