[vlc-commits] gui/qt: remove premature return in PLModel::isSupportedAction

Filip Roséen git at videolan.org
Sun Jul 24 20:39:14 CEST 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Sat Jul 23 15:45:42 2016 +0200| [0b6a51edf31db78b49575c37b9eb49800edea648] | committer: Francois Cartegnie

gui/qt: remove premature return in PLModel::isSupportedAction

The index passed will be considered invalid if the user right-clicks on
an area that does not belong to an entity.

Given that there are options that certainly are supported when such
right-click is in flight, we should not prematurely return from the
function; instead each case should respect whether we have a non-root
item tied to the on-going request or not.

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

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

 modules/gui/qt/components/playlist/playlist_model.cpp |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/modules/gui/qt/components/playlist/playlist_model.cpp b/modules/gui/qt/components/playlist/playlist_model.cpp
index 6499797..0f2ce33 100644
--- a/modules/gui/qt/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt/components/playlist/playlist_model.cpp
@@ -1001,9 +1001,6 @@ bool PLModel::action( QAction *action, const QModelIndexList &indexes )
 
 bool PLModel::isSupportedAction( actions action, const QModelIndex &index ) const
 {
-    if( !index.isValid() )
-        return false;
-
     const PLItem *item = getItem( index );
 
     switch ( action )



More information about the vlc-commits mailing list