On Tue, Dec 1, 2009 at 11:46 PM, Milian Wolff <mail@milianw.de> wrote:
On Tuesday 01 December 2009 23:21:24 Aleix Pol wrote:
...

> > Hm, one thing I forgot:
> > should the IDocumentationProvider returned by m_provider be const? I mean
> > the
> > public API only consists of const stuff, but I still have to const_cast<>
> > it
> > before I can return it...
> >
> > And it looks like pointer to providers are used quite often in
> > KDevplatform (the documentation controller esp.).
> >
> > It would require lots of (simple) changes there, just to get rid of a
> > single
> > const_cast - is it worth it?


Well, why is the IDocument not interested on the provider being able to change?
 
...

> What I do in Qt doc is to have a static member with the provider and return
> that one.
> That way every IDocumentation instance doesn't store a pointer to the
> provider (which is shared, of course).

Yeah, saw that but find it (personally) even worse than the static cast ;-) So
I'll leave it as-is.
I don't see why it's worse, it's cheaper and kind of makes sense to have them all pointing to the same provider.
It's just not interface-driven.
 

Thanks Apol.

--

--
KDevelop-devel mailing list
KDevelop-devel@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel