Commit 6eabc8bc authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Qt4 - Cleanups and use QMenu on the stack to avoid leaks. Show menu with exec instead of popup.

parent 684cafc4
......@@ -75,7 +75,7 @@ private:
QPushButton *repeatButton , *randomButton,*addButton;
ClickLineEdit *searchLine;
int currentRootId;
QSignalMapper *ContextUpdateMapper;
QSignalMapper *ContextUpdateMapper;
public slots:
void removeItem( int );
virtual void setRoot( int );
......
......@@ -188,32 +188,32 @@ void StandardPLPanel::setCurrentRootId( int _new )
void StandardPLPanel::add()
{
QMenu *popup = new QMenu();
QMenu popup;
if( currentRootId == THEPL->p_local_category->i_id ||
currentRootId == THEPL->p_local_onelevel->i_id )
{
popup->addAction( qtr(I_PL_ADDF), THEDP, SLOT(simplePLAppendDialog()));
popup->addAction( qtr(I_PL_ADVADD), THEDP, SLOT(PLAppendDialog()) );
popup->addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( PLAppendDir()) );
popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT(simplePLAppendDialog()));
popup.addAction( qtr(I_PL_ADVADD), THEDP, SLOT(PLAppendDialog()) );
popup.addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( PLAppendDir()) );
}
else if( currentRootId == THEPL->p_ml_category->i_id ||
currentRootId == THEPL->p_ml_onelevel->i_id )
{
popup->addAction( qtr(I_PL_ADDF), THEDP, SLOT(simpleMLAppendDialog()));
popup->addAction( qtr(I_PL_ADVADD), THEDP, SLOT( MLAppendDialog() ) );
popup->addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( MLAppendDir() ) );
popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT(simpleMLAppendDialog()));
popup.addAction( qtr(I_PL_ADVADD), THEDP, SLOT( MLAppendDialog() ) );
popup.addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( MLAppendDir() ) );
}
popup->popup( QCursor::pos() );
popup.exec( QCursor::pos() );
}
void StandardPLPanel::popupSelectColumn( QPoint )
{
ContextUpdateMapper = new QSignalMapper(this);
QMenu *selectColMenu = new QMenu( qtr("Show columns") );
QMenu selectColMenu;
#define ADD_META_ACTION( meta ) { \
QAction* option = selectColMenu->addAction( qfu(VLC_META_##meta) ); \
QAction* option = selectColMenu.addAction( qfu(VLC_META_##meta) ); \
option->setCheckable( true ); \
option->setChecked( model->shownFlags() & VLC_META_ENGINE_##meta ); \
ContextUpdateMapper->setMapping( option, VLC_META_ENGINE_##meta ); \
......@@ -232,7 +232,7 @@ void StandardPLPanel::popupSelectColumn( QPoint )
#undef ADD_META_ACTION
selectColMenu->popup( QCursor::pos() );
selectColMenu.exec( QCursor::pos() );
}
void StandardPLPanel::clearFilter()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment