Roberto Raggi roberto.raggi at gmail.com
Mon Jul 2 15:01:43 UTC 2007


Il giorno 01/lug/07, alle ore 16:21, Jens Herden ha scritto:

> Hi,
> we have:
>     virtual IProject* projectAt( int ) const = 0;
>     virtual int projectCount() const = 0;
>     virtual QList<IProject*> projects() const = 0;
> Do we really need all of them? I think it should be OK to drop  
> projectAt() and
> projectCount() .

if you want drop one you should drop projects() :-) projectAt(int) is  
virtual and it returns a pointer to an IProject. That's great,  
because you can use covariant returns to keep your code clean and  
simple. For example, if AutomakeProject extends IProject you can write
   virtual AutomakeProject *projectAt(int index) { ... }

then you don't need awful casts from IProject* to AutomakeProject* in  
your plug-in.

ciao robe

More information about the KDevelop-devel mailing list