[Amarok] Always reload the decorator actions.

Seb Ruiz ruiz at kde.org
Wed Feb 10 00:08:34 CET 2010


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/


More information about the Amarok-devel mailing list