[vlc-devel] [PATCH 17/18] gui/qt: fix #10051 (unable to create playlist directory)

Filip Roséen filip at videolabs.io
Wed Jul 20 04:37:07 CEST 2016


This patch fixes the bug where you cannot create a new directory in the
playlist/medialibrary unless you do it by right-clicking on an existing
item.

In other words; if you try to create a directory in a context where the
list is empty, it would not work. The reason is quite simple,
PLModel::createNode should not prematurely return just because the
passed index is invalid (ie. does not refer to a specific item).
---
 modules/gui/qt/components/playlist/playlist_model.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/components/playlist/playlist_model.cpp b/modules/gui/qt/components/playlist/playlist_model.cpp
index 11fc79b..3092895 100644
--- a/modules/gui/qt/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt/components/playlist/playlist_model.cpp
@@ -887,7 +887,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 );
 
-- 
2.9.0



More information about the vlc-devel mailing list