GenericProjectManager improvements

Andreas Pakulat apaku at gmx.de
Sat Oct 4 22:50:22 UTC 2008


On 04.10.08 21:04:03, Niko Sams wrote:
> > I think thats the better idea, that way the project toolview can do the
> > watching and just refresh the changed files or directories (if files/dirs were
> > added/removed).
> Where should I do the watching? The best would be in the ProjectManager - so
> CMake/QMake can correctly handle their special nodes. But then the
> ProjectManager
> needs to know what is currently open. So the ProjectManagerView needs to emit
> signals when the view changes. But how does the ProjectManager get
> these signals?
> I can't find the view-plugin as it doesn't have a special interface.

Hmm, thinking about it again, this won't work. The model must not have any
idea about the views that work on it and vice-versa.

However I don't think manual refresh is a good option either. My
/proc/sys/fs/inotify/max_user_instances tells me that 8192 watches per
inotify instance may be active. Quickly looking at KDirWatcher's
implementation its pretty obvious that each KDirWatcher instance has 1
inotify instance. So this means a project manager is able to watch as many
files as it wants, it might just have to create more KDirWatcher instances
and manage them. In cases such as the GenericProjectManager one might even
need multiple instances per project. For others 1 KDirWatcher/Project might
be enough most of the time.

Also this of course only is a problem with inotify, distributions mostly
use fam/gamin, windows has a different system and other platforms too.

The question is: Do we want to write the code that does:

if( num_watched_files > max_user_watches && inotify_used) {
  Manage multiple KDirWatch instances per project
} else {
  Use 1 KDirWatch per project manager - or maybe project
}

??

Andreas

-- 
You will contract a rare disease.




More information about the KDevelop-devel mailing list