Can IDocumentationProvider::homePage be non-const?
aleixpol at kde.org
Tue Dec 1 23:14:35 UTC 2009
On Tue, Dec 1, 2009 at 11:46 PM, Milian Wolff <mail at 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
> > > the
> > > public API only consists of const stuff, but I still have to
> > > 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
> > What I do in Qt doc is to have a static member with the provider and
> > 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 ;-)
> 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.
> Milian Wolff
> mail at milianw.de
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KDevelop-devel