qt4: let the main popup menu take ownership of the sort sub-menu
[vlc.git] / modules / gui / qt4 / components / playlist / playlist_model.cpp
index 9cf2509..11e1f88 100644 (file)
@@ -985,11 +985,12 @@ void PLModel::popup( QModelIndex & index, QPoint &point, QModelIndexList list )
             menu->addAction( qtr(I_POP_INFO), this, SLOT( popupInfo() ) );
             if( node )
             {
-                QMenu *sort_menu = new QMenu( qtr(I_POP_SORT) );
-                sort_menu->addAction( qtr( "Ascending" ), this, SLOT( popupSortAsc() ) );
-                sort_menu->addAction( qtr( "Descending" ), this, SLOT( popupSortDesc() ) );
                 menu->addSeparator();
-                menu->addMenu( sort_menu );
+                QMenu *sort_menu = menu->addMenu( qtr(I_POP_SORT) );
+                sort_menu->addAction( qtr( "Ascending" ),
+                    this, SLOT( popupSortAsc() ) );
+                sort_menu->addAction( qtr( "Descending" ),
+                    this, SLOT( popupSortDesc() ) );
             }
         }
         if( node && tree )