Skip to content

Commit

Permalink
* Proper fix for QueryLabel's context menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Jun 30, 2012
1 parent cfa4210 commit e459307
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/libtomahawk/widgets/QueryLabel.cpp
Expand Up @@ -509,23 +509,25 @@ QueryLabel::contextMenuEvent( QContextMenuEvent* event )
{
m_contextMenu->clear();

if ( m_result )
switch( m_hoverType )
{
switch( m_hoverType )
case Artist:
{
case Artist:
m_contextMenu->setArtist( m_result->artist() );
break;
case Album:
m_contextMenu->setAlbum( m_result->album() );
break;

default:
m_contextMenu->setQuery( m_query );
artist_ptr artist = Artist::get( m_query->artist() );
m_contextMenu->setArtist( artist );
break;
}
case Album:
{
artist_ptr artist = Artist::get( m_query->artist() );
album_ptr album = Album::get( artist, m_query->album() );
m_contextMenu->setAlbum( album );
break;
}

default:
m_contextMenu->setQuery( m_query );
}
else
m_contextMenu->setQuery( m_query );

m_contextMenu->exec( event->globalPos() );
}
Expand Down

0 comments on commit e459307

Please sign in to comment.