ProjectItem vs. ProjectFolderItem
Andreas Pakulat
apaku at gmx.de
Sun Sep 30 09:51:02 UTC 2007
Hi,
as Aleix pointed out its currently quite ugly to create custom
ProjectItem's for your buildmanager. The reason is that you'd have to
subclass KDevelop::ProjectItem+<custom folder item> resulting in this:
class QMakeProjectItem : public ProjectItem, QMakeFolderItem
{
};
The reason why this is ugly because the inheritance graph for this is
now:
ProjectFolderItem
|
----------+-------------
| |
QMakeFolderItem ProjectItem
| |
----------+-------------
|
QMakeProjectItem
(not 100% correct, I left out the ProjectBuildFolderItem)
So we have that dreaded diamond-shape inheritance :(
Unfortunately I don't see a way of removing this inheritance graph
without having to duplicate the code between ProjectFolderItem and
ProjectItem (and thus all subclasses as well).
All those Item classes are ProjectBaseItem subclasses which is a
QStandardItem subclass.
The only way I currently see is making the project item a separate thing
from the source folder of the project. Of course you'd see that in the
project manager, so we'd have "Project->project-source-folder" instead of
only "Project" in the hierarchy.
My question is: Did I overlook a way to solve that inheritance dilemma
without having to duplicate code? (I thought about changing to
has-a-relationship between projectitem and projectfolderitem, but then
you'd still get the new hierarchy in the project manager)
Andreas
--
Your step will soil many countries.
More information about the KDevelop-devel
mailing list