[vlc-commits] gui/qt: fix PLModel::isSupportedAction( ACTION_CREATENODE, ... )
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 15:16:07 2016 +0200| [02ac2d7e0fdf6d733532b4f4b64582320e32991a] | committer: Francois Cartegnie
gui/qt: fix PLModel::isSupportedAction( ACTION_CREATENODE, ... )
The associated logic has been changed so that the option is enabled, if;
- we are allowed to modify the playlist, and;
- the playlist is a tree, and;
- we either are creating a top-level entity, or the entity to which
the newly created node will belong is not read-only.
Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=02ac2d7e0fdf6d733532b4f4b64582320e32991a
---
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 0ea1acc..9c1a902 100644
--- a/modules/gui/qt/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt/components/playlist/playlist_model.cpp
@@ -1042,7 +1042,7 @@ bool PLModel::isSupportedAction( actions action, const QModelIndex &index ) cons
case ACTION_EXPLORE:
return getURI( index ).startsWith( "file://" );
case ACTION_CREATENODE:
- return ( isTree() && !item->readOnly() );
+ return canEdit() && isTree() && ( !item || !item->readOnly() );
case ACTION_RENAMENODE:
return ( index != rootIndex() ) && !isLeaf( index ) && !item->readOnly();
case ACTION_CLEAR:
More information about the vlc-commits
mailing list