[vlc-commits] gui/qt: fix PLModel::isSupportedAction( ACTION_SAVETOPLAYLIST, ... )

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> | Sun Jul 24 17:56:58 2016 +0200| [6e17d45c5cdff007de44a0d0e43bbed3b7e7b0a4] | committer: Francois Cartegnie

gui/qt: fix PLModel::isSupportedAction( ACTION_SAVETOPLAYLIST, ... )

Given that the relevant action saves the current playlist (ie.
ROOTTYPE_CURRENT_PLAYING) to a file, it only make sense to show this
option if the user is actually looking at that playlist.

This commit changes the logic associated so that it appears when that is
the case, not just because we have items in the current view.

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

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

 modules/gui/qt/components/playlist/playlist_model.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/components/playlist/playlist_model.cpp b/modules/gui/qt/components/playlist/playlist_model.cpp
index ff9c98a..6ea7c09 100644
--- a/modules/gui/qt/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt/components/playlist/playlist_model.cpp
@@ -1060,7 +1060,7 @@ bool PLModel::isSupportedAction( actions action, const QModelIndex &index ) cons
     case ACTION_ENQUEUEGENERIC:
         return canEdit();
     case ACTION_SAVETOPLAYLIST:
-        return rowCount() > 0;
+        return getPLRootType() == ROOTTYPE_CURRENT_PLAYING && rowCount();
     default:
         return false;
     }



More information about the vlc-commits mailing list