1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 03:40:16 +02:00

* Use displayQuery for more readable code.

This commit is contained in:
Christian Muehlhaeuser
2012-06-16 11:24:49 +02:00
parent 867761f449
commit bae8de0ca5

View File

@@ -685,34 +685,20 @@ TrackView::mousePressEvent( QMouseEvent* event )
{ {
case PlayableModel::Artist: case PlayableModel::Artist:
{ {
if ( item->query()->numResults() ) ViewManager::instance()->show( Artist::get( item->query()->displayQuery()->artist() ) );
{
ViewManager::instance()->show( item->query()->results().first()->artist() );
}
else
{
ViewManager::instance()->show( Artist::get( item->query()->artist() ) );
}
break; break;
} }
case PlayableModel::Album: case PlayableModel::Album:
{ {
if ( item->query()->numResults() ) artist_ptr artist = Artist::get( item->query()->displayQuery()->artist() );
{ ViewManager::instance()->show( Album::get( artist, item->query()->displayQuery()->album() ) );
ViewManager::instance()->show( item->query()->results().first()->album() );
}
else
{
artist_ptr artist = Artist::get( item->query()->artist() );
ViewManager::instance()->show( Album::get( artist, item->query()->album() ) );
}
break; break;
} }
case PlayableModel::Track: case PlayableModel::Track:
{ {
ViewManager::instance()->show( item->query() ); ViewManager::instance()->show( item->query()->displayQuery() );
break; break;
} }