[vlc-commits] Only allow clearing playlist if current item can be edited

Edward Wang git at videolan.org
Mon Jan 9 23:22:24 CET 2012


vlc | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Mon Jan  9 17:09:15 2012 -0500| [b3203a51c486119b95cb183d53fc40fe8e887a22] | committer: Jean-Baptiste Kempf

Only allow clearing playlist if current item can be edited

Only allow clearing playlist if current item can be edited.
Thanks,
	Edward Wang

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

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

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 4e69d3c..a23f9c9 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -978,8 +978,10 @@ bool PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
 
     menu.addSeparator();
 
-    menu.addAction( QIcon( ":/toolbar/clear" ), qtr("Clear playlist"),
-                    this, SLOT( clearPlaylist() ) );
+    if( canEdit() ) {
+        menu.addAction( QIcon( ":/toolbar/clear" ), qtr("Clear playlist"),
+                        this, SLOT( clearPlaylist() ) );
+    }
 
     /* Playlist sorting */
     if( !sortingMenu )



More information about the vlc-commits mailing list