extragear/multimedia/amarok/src/browsers/collectionbrowser

Seb Ruiz ruiz at kde.org
Mon Mar 23 22:48:00 CET 2009


2009/3/23 Nikolaj Hald Nielsen <nhnFreespirit at gmail.com>:
> SVN commit 943083 by nhnielsen:
>
> Make double clicking a top level item in a  CollectionTreeView behave just like any other item. This once again makes it possible to add Cool Streams tracks (as this is a collection where the tracks _are_ the top level) as well
> as entire Magnatune genres and Ampache artist by double cliking.
>
> This does behave a bit odly with top level items as these apparently have special code that expands/closes them on a single click. I suppose this was added to get rid of the "+" button on the new collection headers, but I am not
> quite sure I like this aproach. Perhaps having the "+" button is better after all?

Would have been nice to speak to me about this first! Instead what I
think you should have done was reimplement the click handler in your
service trees. Double clicking on root collection items will now add
the entire collection to the playlist (instead of expanding), which is
sub optimal.

I do not think the "+" button is better as it looks odd and forces a
loss of that precious horizontal space.

>
>
>
>  M  +2 -11     CollectionTreeView.cpp
>
>
> --- trunk/extragear/multimedia/amarok/src/browsers/collectionbrowser/CollectionTreeView.cpp #943082:943083
> @@ -256,17 +256,8 @@
>
>     if( index.isValid() )
>     {
> -        if( !index.parent().isValid() ) // root item
> -        {
> -            QModelIndex index2 = indexAt( event->pos() );
> -            setExpanded( index2, !isExpanded( index2 ) );
> -        }
> -        else if( index.internalPointer() )
> -        {
> -            CollectionTreeItem *item = static_cast<CollectionTreeItem*>( index.internalPointer() );
> -
> -            playChildTracks( item, Playlist::AppendAndPlay );
> -        }
> +        CollectionTreeItem *item = static_cast<CollectionTreeItem*>( index.internalPointer() );
> +        playChildTracks( item, Playlist::AppendAndPlay );
>     }
>  }
>
>



-- 
Seb Ruiz

http://www.sebruiz.net/
http://amarok.kde.org/


More information about the Amarok-devel mailing list