KDevPlatform Plugin loading

Alexander Dymo dymo at ukrpost.ua
Wed Mar 21 18:27:56 UTC 2007


On Wednesday 21 March 2007 19:11, Branan Riley wrote:
> Right now, plugin loading isn't quite decided on for KDevPlatform. That's a
> rather important (IMHO) thing to get done, as it will really define how
> everything works together. I have a few ideas for enumerating plugins, and
> for loading them.

I'll describe here how plugins are loaded in kdev3 to better understand
the problem and to see what's necessary to do.

There're so-called "Profiles" in KDevelop3.
A profile is:
- a list of "properties"
- a list of explicitly disabled plugins
- a list of explicitly enabled plugins

A profile property describes a feature or a set of features.
Example properties are:
FileCreation, CppDevelopment, RubyDebugger, etc.

Profiles are organized into a hierarchy. The nested profiles derive
properties from parent profiles. kdevprofileeditor program shows the whole
hierarchy of profiles.

A plugin from its side also defines a list of properties using
X-KDevelop-Properties variable in .desktop files.

When KDevelop or any other platform application starts, it sets the profile
name using ShellExtension.
Plugin loader looks at the name and ask a profile to get its plugins.
All plugins that have non-empty intersection of their own properties with
profile properties are loaded.
All plugins that are listed as explicitly enabled for this profile are 
loaded too.
All plugins that are listed as explicitly disabled are not loaded
automatically, but rather appear in KDevelop plugin selection dialog
so that the user can load them later.

KDevelop is usually loaded with "IDE" profile.

When a project is loaded, the project manager sees if the .kdevelop file
has <profile> node and if it has, it asks the plugin controller to change 
the profile and load plugins for that profile.
If <profile> is not in .kdevelop file, the project manager uses the language
and keywords in .kdevelop file and projectprofiles config file to find out the
profile name.
For example, for C++ project, C++ IDE profile will be loaded.
For C++ project with Qt and KDE keywords, the C++ IDE for KDE profile
will be loaded.

This is more-or-less the general idea of KDevelop 3 Profiles.




More information about the KDevelop-devel mailing list