Commit 52f31595 authored by Filip Roséen's avatar Filip Roséen Committed by François Cartegnie

gui/qt: fix PLModel::createNode when invoked with rootIndex()

This patch fixes ticket #10051, where it is described that one cannot
create a new directory in the playlist/media-library unless one does it
by right-clicking on an existing item.

In other words; if a request to create a directory is initiated in a
context where the list is empty, it would not work.

The reason is imply because the function prematurely returns if the
passed index does not refer to a specific item, and as such the relevant
check (and premature return) is removed in this commit.

PLModel::createNode already has functionality in place to handle
creating directories as top-level of the relevant playlist, so the
premature return was just blocking this from kicking in.
Signed-off-by: François Cartegnie's avatarFrancois Cartegnie <fcvlcdev@free.fr>
parent 6ccc5f15
......@@ -888,7 +888,8 @@ void PLModel::removeAll()
void PLModel::createNode( QModelIndex index, QString name )
{
if( name.isEmpty() || !index.isValid() ) return;
if( name.isEmpty() )
return;
vlc_playlist_locker pl_lock ( THEPL );
......
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