1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

Emit trackCountChanged when dropping tracks in a playlist. Handle Qt/Mac bug where drops from outside the app are Qt::MoveAction not Qt::CopyAction

This commit is contained in:
Leo Franchi
2011-08-05 11:57:42 -04:00
parent 7feb9d5249
commit 4d31eac5f6

View File

@@ -420,8 +420,18 @@ PlaylistModel::parsedDroppedTracks( QList< query_ptr > tracks )
}
emit endInsertRows();
if ( m_dropStorage.action == Qt::CopyAction )
// Work around Qt-on-mac bug where drags from outside the app are Qt::MoveAction
// instead of Qt::CopyAction
#ifdef Q_OS_MAC
if ( m_dropStorage.action & Qt::CopyAction || m_dropStorage.action & Qt::MoveAction )
#else
if ( m_dropStorage.action & Qt::CopyAction )
#endif
{
onPlaylistChanged( true );
emit trackCountChanged( rowCount( QModelIndex() ) );
}
}
m_dropStorage.parent = QPersistentModelIndex();