+ if( i_popup_item > -1 )
+ {
+ if( rootItem->id() != THEPL->p_playing->i_id )
+ menu.addAction( qtr( "Add to playlist"), this, SLOT( popupAddToPlaylist() ) );
+ menu.addAction( QIcon( ":/buttons/playlist/playlist_remove" ),
+ qtr(I_POP_DEL), this, SLOT( popupDel() ) );
+ menu.addSeparator();
+ if( !sortingMenu )
+ {
+ sortingMenu = new QMenu( qtr( "Sort by" ) );
+ sortingMapper = new QSignalMapper( this );
+ for( int i = 1, j = 1; i < COLUMN_END; i <<= 1, j++ )
+ {
+ if( i == COLUMN_NUMBER ) continue;
+ QMenu *m = sortingMenu->addMenu( qfu( psz_column_title( i ) ) );
+ QAction *asc = m->addAction( qtr("Ascending") );
+ QAction *desc = m->addAction( qtr("Descending") );
+ sortingMapper->setMapping( asc, j );
+ sortingMapper->setMapping( desc, -j );
+ CONNECT( asc, triggered(), sortingMapper, map() );
+ CONNECT( desc, triggered(), sortingMapper, map() );
+ }
+ CONNECT( sortingMapper, mapped( int ), this, popupSort( int ) );
+ }
+ menu.addMenu( sortingMenu );
+ }
+
+ if( !menu.isEmpty() )
+ {
+ menu.exec( point ); return true;
+ }
+ else return false;