qt4: let the main popup menu take ownership of the sort sub-menu
authorJakob Leben <jleben@videolan.org>
Tue, 18 Aug 2009 17:45:03 +0000 (19:45 +0200)
committerJakob Leben <jleben@videolan.org>
Tue, 18 Aug 2009 17:45:03 +0000 (19:45 +0200)
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 )