Global selection and defaultBounds

Sven Langkamp sven.langkamp at gmail.com
Sat Mar 27 19:10:48 CET 2010


On Sat, Mar 27, 2010 at 7:05 PM, Dmitry Kazakov <dimula73 at gmail.com> wrote:

>
>
> On Sat, Mar 27, 2010 at 8:56 PM, Sven Langkamp <sven.langkamp at gmail.com>wrote:
>
>> On Sat, Mar 27, 2010 at 6:51 PM, Dmitry Kazakov <dimula73 at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20100327/6f144533/attachment.htm 


More information about the kimageshop mailing list