[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: branches/koffice/2.0/koffice/krita/plugins/paintops/libbrush
From: Cyrille Berger <cberger () cberger ! net>
Date: 2009-04-23 12:23:31
Message-ID: 200904231423.32650.cberger () cberger ! net
[Download RAW message or body]
On Thursday 23 April 2009, Boudewijn Rempt wrote:
> On Thu, 23 Apr 2009, Cyrille Berger wrote:
> > On Thursday 23 April 2009, Boudewijn Rempt wrote:
> > > This is a bit tricky & ugly, but it does work around the problem
> > > that we cannot put shared pointers into a resource server
> >
> > Why not ?
>
> For one thing, because of the KoResource* signature of the createResource
> method, see lines like
>
> T* resource = createResource(front);
>
> in KoResourceServer:107.
>
> Boudewijn
A solution would be:
Replace:
template <class T> class KoResourceServer : public KoResourceServerBase {
by
template <class T, class TStar = T*> class KoResourceServer : public
KoResourceServerBase {
And replace all T* by TStar in that class. Then when instanciating the
resource server for brush, we will do KoResourceServer<KisBrush, KisBrushSP> .
--
Cyrille Berger
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; \
font-weight:400; font-style:normal;">On Thursday 23 April 2009, Boudewijn Rempt \
wrote:<br> > On Thu, 23 Apr 2009, Cyrille Berger wrote:<br>
> > On Thursday 23 April 2009, Boudewijn Rempt wrote:<br>
> > > This is a bit tricky & ugly, but it does work around the \
problem<br> > > > that we cannot put shared pointers into a resource \
server<br> > ><br>
> > Why not ?<br>
><br>
> For one thing, because of the KoResource* signature of the createResource<br>
> method, see lines like<br>
><br>
> T* resource = createResource(front);<br>
><br>
> in KoResourceServer:107.<br>
><br>
> Boudewijn<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>A solution would be:<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Replace:<br> template <class T> class \
KoResourceServer : public KoResourceServerBase {<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>by<br> template <class T, class TStar = T*> class \
KoResourceServer : public KoResourceServerBase {<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>And \
replace all T* by TStar in that class. Then when instanciating the resource server \
for brush, we will do KoResourceServer<KisBrush, KisBrushSP> .<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>-- \
<br> Cyrille Berger</p></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic