[Amarok] Always reload the decorator actions.

Bart Cerneels bart.cerneels at kde.org
Wed Feb 10 08:03:08 CET 2010


Got numbers?
It probably can be but I didn't notice any lag. Anyway, it's the
painting itself that is slow, we didn't cache the pixmap before
either.
 Perhaps we can switch to using qaction::disabled but then we can't
add new actions.

On 10/02/2010, Seb Ruiz <ruiz at kde.org> wrote:
> On 10 February 2010 07:10, Bart Cerneels <bart.cerneels at kde.org> wrote:
>>  QList<QAction*>
>>  CollectionTreeItem::decoratorActions() const
>>  {
>> -    if( m_decoratorActionsLoaded )
>> -        return m_decoratorActions;
>> -
>> +    QList<QAction*> decoratorActions;
>>     Meta::DecoratorCapability *dc =
>> m_parentCollection->create<Meta::DecoratorCapability>();
>>     if( dc )
>>     {
>> -        m_decoratorActions = dc->decoratorActions();
>> +        decoratorActions = dc->decoratorActions();
>>         delete dc;
>>     }
>> -
>> -    m_decoratorActionsLoaded = true;
>> -    return m_decoratorActions;
>> +    return decoratorActions;
>>  }
>
> I fear that this could be very slow. Having the recreate the actions
> on every paint event seems overkill.
>
>
>
> --
> Seb Ruiz
>
> http://www.sebruiz.net/
> http://amarok.kde.org/
> _______________________________________________
> Amarok-devel mailing list
> Amarok-devel at kde.org
> https://mail.kde.org/mailman/listinfo/amarok-devel
>

-- 
Sent from my mobile device


More information about the Amarok-devel mailing list