[vlc-devel] commit: qt4: let the main popup menu take ownership of the sort sub-menu ( Jakob Leben )

git version control git at videolan.org
Tue Aug 18 19:46:48 CEST 2009


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Tue Aug 18 19:45:03 2009 +0200| [0ec84ebbe8b2a13b60450f7dec8fa164d351aca8] | committer: Jakob Leben 

qt4: let the main popup menu take ownership of the sort sub-menu

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0ec84ebbe8b2a13b60450f7dec8fa164d351aca8
---

 .../gui/qt4/components/playlist/playlist_model.cpp |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 9cf2509..11e1f88 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -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 )




More information about the vlc-devel mailing list