[vlc-devel] [PATCH] Qt4: Select Playlist in PLSelector by default

Edward Wang edward.c.wang at compdigitec.com
Mon Jan 2 03:09:28 CET 2012


Fixes a bug in the PLSelector that seems to occur only when there is no focus to the PLSelector widget, causing currentItem() to be NULL and causing sporadic crashes.

Close #5764

Thanks,
    Edward Wang

---
 modules/gui/qt4/components/playlist/selector.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index 693d454..907254e 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -188,6 +188,8 @@ void PLSelector::createItems()
     PLSelItem *pl = putPLData( addItem( PL_ITEM_TYPE, N_("Playlist"), true ),
                               THEPL->p_playing );
     pl->treeItem()->setData( 0, SPECIAL_ROLE, QVariant( IS_PL ) );
+    /* Ensure PL is selected by default for anything that uses currentItem() */
+    setCurrentItem( pl->treeItem() );

     /* ML */
     PLSelItem *ml = putPLData( addItem( PL_ITEM_TYPE, N_("Media Library"), true ),
--
1.7.5.4




More information about the vlc-devel mailing list