[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Re: Global selection and defaultBounds
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2010-03-27 18:30:20
Message-ID: ae32c1ef1003271130s4709776bj8ec5e848735f3801 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sat, Mar 27, 2010 at 9:10 PM, Sven Langkamp <sven.langkamp@gmail.com>wrote:

> On Sat, Mar 27, 2010 at 7:05 PM, Dmitry Kazakov <dimula73@gmail.com>wrote:
>
>>
>>
>> On Sat, Mar 27, 2010 at 8:56 PM, Sven Langkamp <sven.langkamp@gmail.com>wrote:
>>
>>> On Sat, Mar 27, 2010 at 6:51 PM, Dmitry Kazakov <dimula73@gmail.com>wrote:
>>>
>>>> Great work!
>>>>
>>>> Can i make a couple of stylish comments? ;)
>>>>
>>>> I think in KisMask::selection()
>>>>  {
>>>>      if (!m_d->selection) {
>>>> +        // FIXME: this violates the const
>>>>          m_d->selection = new KisSelection();
>>>> +        const KisLayer *parentLayer = qobject_cast<const
>>>> KisLayer*>(parent());
>>>> +
>>>> m_d->selection->setDefaultBounds(KisDefaultBounds(parentLayer->image()));
>>>>
>>>>
>>>> you can shorten the code a bit:
>>>>
>>>>      if (!m_d->selection) {
>>>> +        // FIXME: this violates the const
>>>> +         setSelection(new KisSelection());
>>>>
>>>> I don't know whether it would compile due to const problem, just an
>>>> idea...
>>>>
>>>
>>> It wouldn't compile because of the const.
>>>
>>
>> ok. Why do we use const here? Is it inherited method?
>>
>
> It's called in some other const methods.
>


pity...
Boud, could you suggest something?
-- 
Dmitry Kazakov

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">On Sat, Mar 27, 2010 at 9:10 PM, Sven Langkamp <span \
dir="ltr">&lt;<a href="mailto:sven.langkamp@gmail.com">sven.langkamp@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div><div></div><div \
class="h5"><div class="gmail_quote">On Sat, Mar 27, 2010 at 7:05 PM, Dmitry Kazakov \
<span dir="ltr">&lt;<a href="mailto:dimula73@gmail.com" \
target="_blank">dimula73@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, \
204, 204); padding-left: 1ex;"> <br><br><div \
class="gmail_quote"><div><div></div><div>On Sat, Mar 27, 2010 at 8:56 PM, Sven \
Langkamp <span dir="ltr">&lt;<a href="mailto:sven.langkamp@gmail.com" \
target="_blank">sven.langkamp@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px \
solid rgb(204, 204, 204); padding-left: 1ex;"> <div><div class="gmail_quote">On Sat, \
Mar 27, 2010 at 6:51 PM, Dmitry Kazakov <span dir="ltr">&lt;<a \
href="mailto:dimula73@gmail.com" target="_blank">dimula73@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



Great work!<br><br>Can i make a couple of stylish comments? ;)<br><br>I think in  \
KisMask::selection()<br>  {<br>         if (!m_d-&gt;selection) {<br>+               \
// FIXME: this violates the const<br>                 m_d-&gt;selection = new \
KisSelection();<br>




+               const KisLayer *parentLayer = qobject_cast&lt;const \
KisLayer*&gt;(parent());<br>+               \
m_d-&gt;selection-&gt;setDefaultBounds(KisDefaultBounds(parentLayer-&gt;image()));<br><br><br>you \
can shorten the code a bit:<br>




<br>         if (!m_d-&gt;selection) {<br>
+               // FIXME: this violates the const<br>+                
setSelection(new KisSelection());<br><br>I don&#39;t know whether it would compile \
due to const problem, just an idea...<br></blockquote></div><br></div>It wouldn&#39;t \
compile because of the const.<br></blockquote></div>

</div><div>
<br>ok. Why do we use const here? Is it inherited method?<br></div></div>
</blockquote></div><br></div></div>It&#39;s called in some other const methods. \
<br></blockquote><div><br><br>pity...<br>Boud, could you suggest something? \
<br></div></div>-- <br>Dmitry Kazakov<br>



_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic