Commit b29b6241 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4: D&D behaviour fix.

When dropping on the main controller => Play
When dropping on the playlist => Enqueue.
(cherry picked from commit e04cc4a8)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c520abe5
......@@ -135,7 +135,7 @@ PlaylistWidget::~PlaylistWidget()
void PlaylistWidget::dropEvent(QDropEvent *event)
{
if( p_intf->p_sys->p_mi )
p_intf->p_sys->p_mi->dropEvent( event );
p_intf->p_sys->p_mi->dropEventPlay( event, false );
}
void PlaylistWidget::dragEnterEvent(QDragEnterEvent *event)
{
......
......@@ -1076,6 +1076,11 @@ void MainInterface::updateSystrayTooltipStatus( int i_status )
* D&D Events
************************************************************************/
void MainInterface::dropEvent(QDropEvent *event)
{
dropEventPlay( event, true );
}
void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
{
const QMimeData *mimeData = event->mimeData();
......@@ -1094,14 +1099,14 @@ void MainInterface::dropEvent(QDropEvent *event)
}
}
}
bool first = true;
bool first = b_play;
foreach( QUrl url, mimeData->urls() )
{
QString s = toNativeSeparators( url.toLocalFile() );
if( s.length() > 0 ) {
playlist_Add( THEPL, qtu(s), NULL,
PLAYLIST_APPEND | (first ? PLAYLIST_GO:0),
PLAYLIST_APPEND | (first ? PLAYLIST_GO: 0),
PLAYLIST_END, true, false );
first = false;
}
......
......@@ -93,6 +93,7 @@ public:
protected:
// void resizeEvent( QResizeEvent * );
void dropEvent( QDropEvent *);
void dropEventPlay( QDropEvent *, bool);
void dragEnterEvent( QDragEnterEvent * );
void dragMoveEvent( QDragMoveEvent * );
void dragLeaveEvent( QDragLeaveEvent * );
......
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