Commit 02ac2d7e authored by Filip Roséen's avatar Filip Roséen Committed by François 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: François Cartegnie's avatarFrancois Cartegnie <fcvlcdev@free.fr>
parent c5f7d8ef
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment