[vlc-devel] commit: Don't move an item to the middle of nowhere. ( Rémi Duraffort )

git version control git at videolan.org
Fri Aug 22 23:52:12 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Aug 21 20:57:00 2008 +0200| [f01abf1da65773f21d84f6a37b9fd2042cf27f4e] | committer: Rémi Duraffort 

Don't move an item to the middle of nowhere.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f01abf1da65773f21d84f6a37b9fd2042cf27f4e
---

 .../gui/qt4/components/playlist/playlist_model.cpp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 3bb985c..2a55d95 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -149,11 +149,11 @@ bool PLModel::dropMimeData( const QMimeData *data, Qt::DropAction action,
         if( action == Qt::IgnoreAction )
             return true;
 
-        PLItem *targetItem;
-        if( target.isValid() )
-            targetItem = static_cast<PLItem*>( target.internalPointer() );
-        else
-            targetItem = rootItem;
+        if( !target.isValid() )
+            /* We don't want to move on an invalid position */
+            return true;
+
+        PLItem *targetItem = static_cast<PLItem*>( target.internalPointer() );
 
         QByteArray encodedData = data->data( "vlc/playlist-item-id" );
         QDataStream stream( &encodedData, QIODevice::ReadOnly );




More information about the vlc-devel mailing list