[vlc-devel] [PATCH] Qt4 playlist: fix segfault and other enhancements

Jakob Leben jakob.leben at gmail.com
Thu Aug 13 16:15:54 CEST 2009


Has anyone considered if it's cool to have this copy action?

If not, here is a small patch that at least fixes the segmentation fault.
Pick your choose of the three.


>From f7e4f77d834ae77476f644bc29febbe8f46e59d4 Mon Sep 17 00:00:00 2001
From: Jakob Leben <jakob.leben at gmail.com>
Date: Thu, 13 Aug 2009 16:06:51 +0200
Subject: [PATCH] Qt4: fix segfault in playlist

Fix segfault when tree view is disabled and more then one items are moved
from one into another top node (Playlist, Media Library...) and the receiver
node is empty
---
 .../gui/qt4/components/playlist/playlist_model.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp
b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 207b0f5..c49b24c 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -241,8 +241,8 @@ bool PLModel::dropMimeData( const QMimeData *data,
Qt::DropAction action,
             else
             {
                 int i;
-                for( i = 0 ; i< p_parent->i_children ; i++ )
-                    if( p_parent->pp_children[i] == p_target ) break;
+                for( i = 0 ; i< p_target->p_parent->i_children ; i++ )
+                    if( p_target->p_parent->pp_children[i] == p_target )
break;
                 playlist_TreeMove( p_playlist, p_src, p_parent, i + 1 );
             }
             p_target = p_src;
--
1.6.0.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090813/de714852/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Qt4-fix-segfault-in-playlist.patch
Type: text/x-diff
Size: 1330 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090813/de714852/attachment.patch>


More information about the vlc-devel mailing list