[Kde-games-devel] Unify pixmap caching across card games
Matt Williams
matt at milliams.com
Sun Jan 6 21:02:47 CET 2008
On Sunday 06 January 2008 19:39:31 Aaron J. Seigo wrote:
> On Sunday 06 January 2008, Andreas Pakulat wrote:
> > On 06.01.08 16:52:44, Dmitry Suzdalev wrote:
> > > Looks nice!
> > >
> > > Minor thing is: how about adding "const" modifier to "get" methods? :)
> >
> > Not possible, because getXXX might modify data as the requested card
> > might not yet have been in the cache.
>
> if the members are in the dptr then you have nothing to worry about:
> members of the dptr can be modified at will; you can also put methods in
> the private class that need to access non-const methods and call those from
> your const methods. dirty little tricks, but often perfect for keeping the
> API clean.
>
> and i don't know if it matters any to the kdegames devel style, but usually
> we don't use the get prefix for getters. so getBackground would just be
> background and getCard would just be card. perhaps the kdegames libs are
> full of get* methods though (haven't looked) and so without the get prefix
> it would be out of sync?
In all the classes I've written, I've used the kdelibs/Qt style of just doing
background()/setBackground(). If possible, I think we should use this.
Matt Williams
More information about the kde-games-devel
mailing list