[vlc-commits] Qt: display an "empty" action instead of an empty menu

Jean-Baptiste Kempf git at videolan.org
Mon Oct 10 12:01:26 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Oct 10 11:56:10 2011 +0200| [9a635062b551f551c93514c7988a91c797298b88] | committer: Jean-Baptiste Kempf

Qt: display an "empty" action instead of an empty menu

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

 modules/gui/qt4/util/qmenuview.cpp |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/util/qmenuview.cpp b/modules/gui/qt4/util/qmenuview.cpp
index d409812..8ec2d3e 100644
--- a/modules/gui/qt4/util/qmenuview.cpp
+++ b/modules/gui/qt4/util/qmenuview.cpp
@@ -67,6 +67,9 @@ void QMenuView::rebuild()
 
     /* Rebuild from root */
     build( QModelIndex() );
+
+    if( isEmpty() )
+        addAction( qtr( "Empty" ) )->setDisabled( true );
 }
 
 /* */



More information about the vlc-commits mailing list