[vlc-commits] gui/qt: clean PLModel::isSupportedAction( ACTION_ADDTOPLAYLIST, ... )

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


vlc | branch: master | Filip Roséen <filip at atch.se> | Sun Jul 24 15:25:29 2016 +0200| [b0445dcd6ad572841332e5f57e292b5ed8a007bb] | committer: Francois Cartegnie

gui/qt: clean PLModel::isSupportedAction( ACTION_ADDTOPLAYLIST, ... )

A user should be able to add something to the playlist as long as we
are not invoking the action upon an item that is already there,
as such; checking the return-value of getPLRootType() is enough.

This commit removes the redundant check that follow, and also makes it
clear that we would never fall-through to ACTION_SORT.

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

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

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

diff --git a/modules/gui/qt/components/playlist/playlist_model.cpp b/modules/gui/qt/components/playlist/playlist_model.cpp
index 6ea7c09..b9cd87f 100644
--- a/modules/gui/qt/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt/components/playlist/playlist_model.cpp
@@ -1008,9 +1008,7 @@ bool PLModel::isSupportedAction( actions action, const QModelIndex &index ) cons
     {
     case ACTION_ADDTOPLAYLIST:
         /* Only if we are not already in Current Playing */
-        if ( getPLRootType() == ROOTTYPE_CURRENT_PLAYING ) return false;
-        if( index != rootIndex() )
-            return ( item->id( PLAYLIST_ID ) != THEPL->p_playing->i_id );
+		return getPLRootType() != ROOTTYPE_CURRENT_PLAYING;
     case ACTION_SORT:
         return rowCount();
     case ACTION_PLAY:



More information about the vlc-commits mailing list