Can IDocumentationProvider::homePage be non-const?

Aleix Pol 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
> 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.
>
> --
> Milian Wolff
> mail at milianw.de
> http://milianw.de
>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20091202/37bc1cb4/attachment.html>


More information about the KDevelop-devel mailing list