]> git.sesse.net Git - vlc/commitdiff
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 9cf25095ecaffbb1f6f6e03ddadfb746d0786d0d..11e1f8832b8433ad464b6ba00cd72084305b549d 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 )