Global selection and defaultBounds

Dmitry Kazakov dimula73 at gmail.com
Sat Mar 27 19:05:53 CET 2010


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?


-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20100327/bed87905/attachment.htm 


More information about the kimageshop mailing list