IProject, IProjectController and Project Management Infrastructure
From KDevelop
Unlike KDevelop3, KDevelop4 can load many projects at the same time.
The project management infrastructure can be represented with following diagram:
|----------| |---------------------|
|---->| IProject |------>| IProjectFileManager |
| |----------| |---------------------|
| |
|--------------------| | |--------------|
| IProjectController |------->| ProjectModel |
|--------------------| | |--------------|
| |
| |----------| |---------------------|
|---->| IProject |------>| IProjectFileManager |
|----------| |---------------------|
Project controller is a container for projects (IProject interface). Each project contributes its contents (files, folders, targets, etc.) to the ProjectModel. Each project also have a "project file manager" associated with it. Project file manager is the plugin which implements either IProjectFileManager or IBuildSystemManager and provides all actual project management facilities. This way KDevelop4 is able to load as many projects as desired and each of the project can have different build system. Every plugin that wants to display whatever is in projects can use ProjectModel.
KDevelop supports the notion of "current project" (the one which is currently selected) in the project management view. But plugins are encouraged to not depend on it. The selection might be empty or project management view might be closed at any time.
KDevelop Platform provides by default GenericProjectManager which just threats all files and subdirectories under project directory as project items and currently provides no building facilities.
The project file (<projectname>.kdev4) controls which project file manager will be loaded. For example, this .kdev4 file will load Generic manager:
[General Options] Manager=KDevGenericManager
The last thing to note is that this means all plugins have to either be completely independent of a project or they have to be able to work with multiple projects. A plugin that expects only 1 project at a time is considered broken.