<br><br><div><span class="gmail_quote">On 9/30/07, <b class="gmail_sendername">Matt Rogers</b> <<a href="mailto:mattr@kde.org">mattr@kde.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sunday 30 September 2007 04:51:02 am Andreas Pakulat wrote:<br>> Hi,<br>><br>> as Aleix pointed out its currently quite ugly to create custom<br>> ProjectItem's for your buildmanager. The reason is that you'd have to
<br>> subclass KDevelop::ProjectItem+<custom folder item> resulting in this:<br>><br>> class QMakeProjectItem : public ProjectItem, QMakeFolderItem<br>> {<br>> };<br>><br>> The reason why this is ugly because the inheritance graph for this is
<br>> now:<br>><br>> ProjectFolderItem<br>><br>> ----------+-------------<br>><br>> QMakeFolderItem ProjectItem<br>><br>> ----------+-------------<br>
><br>> QMakeProjectItem<br>><br>> (not 100% correct, I left out the ProjectBuildFolderItem)<br>><br>> So we have that dreaded diamond-shape inheritance :(<br>><br><br>Why do we have ProjectItem to begin with? Is there some reason we can't just
<br>add an isProjectRoot() function to ProjectFolderItem?<br><br><br>> Unfortunately I don't see a way of removing this inheritance graph<br>> without having to duplicate the code between ProjectFolderItem and<br>
> ProjectItem (and thus all subclasses as well).<br>><br><br>Remove ProjectItem</blockquote><div><br>Well, I think that the problem was that the project item name was the project name, that's why we used the ProjectItem.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> All those Item classes are ProjectBaseItem subclasses which is a<br>> QStandardItem subclass.
<br>><br><br><br>> The only way I currently see is making the project item a separate thing<br>> from the source folder of the project. Of course you'd see that in the<br>> project manager, so we'd have "Project->project-source-folder" instead of
<br>> only "Project" in the hierarchy.<br>><br>> My question is: Did I overlook a way to solve that inheritance dilemma<br>> without having to duplicate code? (I thought about changing to<br>> has-a-relationship between projectitem and projectfolderitem, but then
<br>> you'd still get the new hierarchy in the project manager)<br>><br>> Andreas<br><br>You did. Remove the inheritance. It's not needed. Add some nice functions to<br>ProjectFolderItem to find the root of the project.
<br>--<br>Matt</blockquote><div><br>Aleix <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">_______________________________________________
<br>KDevelop-devel mailing list<br><a href="mailto:KDevelop-devel@kdevelop.org">KDevelop-devel@kdevelop.org</a><br><a href="https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel">https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
</a><br></blockquote></div><br>