=== modified file 'mixxx/src/library/autodjfeature.cpp' --- mixxx/src/library/autodjfeature.cpp 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/autodjfeature.cpp 2012-12-12 14:41:42 +0000 @@ -70,7 +70,7 @@ QModelIndex /*index*/) { } -bool AutoDJFeature::dropAccept(QList urls) { +bool AutoDJFeature::dropAccept(QList urls, QWidget *pSource) { //TODO: Filter by supported formats regex and reject anything that doesn't match. TrackDAO &trackDao = m_pTrackCollection->getTrackDAO(); @@ -85,7 +85,12 @@ files.append(file); } } - QList trackIds = trackDao.addTracks(files, true); + QList trackIds; + if (pSource) { + trackIds = m_pTrackCollection->getTrackDAO().getTrackIds(files); + } else { + trackIds = trackDao.addTracks(files, true); + } int playlistId = m_playlistDao.getPlaylistIdFromName(AUTODJ_TABLE); // remove tracks that could not be added @@ -98,7 +103,12 @@ return true; } -bool AutoDJFeature::dropAcceptChild(const QModelIndex& /*index*/, QList /*url*/) { +bool AutoDJFeature::dropAcceptChild(const QModelIndex& indices, + QList urls, + QWidget *pSource) { + Q_UNUSED(indices); + Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/autodjfeature.h' --- mixxx/src/library/autodjfeature.h 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/autodjfeature.h 2012-12-12 14:41:42 +0000 @@ -27,8 +27,8 @@ QVariant title(); QIcon getIcon(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls,QWidget *pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); === modified file 'mixxx/src/library/baseplaylistfeature.cpp' --- mixxx/src/library/baseplaylistfeature.cpp 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/baseplaylistfeature.cpp 2012-12-12 14:41:42 +0000 @@ -220,8 +220,9 @@ } } -bool BasePlaylistFeature::dropAccept(QList urls) { +bool BasePlaylistFeature::dropAccept(QList urls, QWidget *pSource) { Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/baseplaylistfeature.h' --- mixxx/src/library/baseplaylistfeature.h 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/baseplaylistfeature.h 2012-12-12 14:41:42 +0000 @@ -34,7 +34,7 @@ public slots: virtual void activate(); virtual void activateChild(const QModelIndex& index); - virtual bool dropAccept(QList urls); + virtual bool dropAccept(QList urls, QWidget *pSource); virtual bool dragMoveAccept(QUrl url); virtual void onLazyChildExpandation(const QModelIndex& index); virtual void htmlLinkClicked(const QUrl & link); === modified file 'mixxx/src/library/browse/browsefeature.cpp' --- mixxx/src/library/browse/browsefeature.cpp 2012-11-30 20:16:46 +0000 +++ mixxx/src/library/browse/browsefeature.cpp 2012-12-12 14:41:42 +0000 @@ -150,14 +150,17 @@ return &m_childModel; } -bool BrowseFeature::dropAccept(QList urls) { +bool BrowseFeature::dropAccept(QList urls, QWidget *pSource) { Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } -bool BrowseFeature::dropAcceptChild(const QModelIndex& index, QList urls){ +bool BrowseFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget* pSource){ Q_UNUSED(index); Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/browse/browsefeature.h' --- mixxx/src/library/browse/browsefeature.h 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/browse/browsefeature.h 2012-12-12 14:41:42 +0000 @@ -30,8 +30,8 @@ QVariant title(); QIcon getIcon(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls, QWidget* pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); === modified file 'mixxx/src/library/cratefeature.cpp' --- mixxx/src/library/cratefeature.cpp 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/cratefeature.cpp 2012-12-12 14:41:42 +0000 @@ -84,12 +84,14 @@ return QIcon(":/images/library/ic_library_crates.png"); } -bool CrateFeature::dropAccept(QList urls) { - Q_UNUSED(urls) +bool CrateFeature::dropAccept(QList urls, QWidget *pSource) { + Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } -bool CrateFeature::dropAcceptChild(const QModelIndex& index, QList urls) { +bool CrateFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget *pSource) { QString crateName = index.data().toString(); int crateId = m_crateDao.getCrateIdByName(crateName); QList files; @@ -99,8 +101,13 @@ files.append(url.toLocalFile()); } - // Adds track, does not insert duplicates, handles unremoving logic. - QList trackIds = m_pTrackCollection->getTrackDAO().addTracks(files, true); + QList trackIds; + if (pSource) { + trackIds = m_pTrackCollection->getTrackDAO().getTrackIds(files); + } else { + // Adds track, does not insert duplicates, handles unremoving logic. + trackIds = m_pTrackCollection->getTrackDAO().addTracks(files, true); + } qDebug() << "CrateFeature::dropAcceptChild adding tracks" << trackIds.size() << " to crate "<< crateId; // remove tracks that could not be added === modified file 'mixxx/src/library/cratefeature.h' --- mixxx/src/library/cratefeature.h 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/cratefeature.h 2012-12-12 14:41:42 +0000 @@ -23,8 +23,8 @@ QVariant title(); QIcon getIcon(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls, QWidget* pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); === modified file 'mixxx/src/library/dao/trackdao.cpp' --- mixxx/src/library/dao/trackdao.cpp 2012-08-02 01:16:39 +0000 +++ mixxx/src/library/dao/trackdao.cpp 2012-12-12 14:41:47 +0000 @@ -111,6 +111,29 @@ return libraryTrackId; } +QList TrackDAO::getTrackIds(QList files) { + QStringList pathList; + FieldEscaper escaper(m_database); + foreach (QFileInfo file, files) { + pathList << escaper.escapeString(file.absoluteFilePath()); + } + QSqlQuery query(m_database); + query.prepare(QString("SELECT library.id FROM library INNER JOIN " + "track_locations ON library.location = track_locations.id " + "WHERE track_locations.location in (%1)").arg(pathList.join(","))); + + if (!query.exec()) { + LOG_FAILED_QUERY(query); + } + + QList ids; + while (query.next()) { + ids.append(query.value(query.record().indexOf("id")).toInt()); + } + + return ids; +} + // Some code (eg. drag and drop) needs to just get a track's location, and it's // not worth retrieving a whole TrackInfoObject. QString TrackDAO::getTrackLocation(int trackId) { @@ -118,7 +141,9 @@ << QThread::currentThread() << m_database.connectionName(); QSqlQuery query(m_database); QString trackLocation = ""; - query.prepare("SELECT track_locations.location FROM track_locations INNER JOIN library ON library.location = track_locations.id WHERE library.id=:id"); + query.prepare("SELECT track_locations.location FROM track_locations " + "INNER JOIN library ON library.location = track_locations.id " + "WHERE library.id=:id"); query.bindValue(":id", trackId); if (!query.exec()) { LOG_FAILED_QUERY(query); === modified file 'mixxx/src/library/dao/trackdao.h' --- mixxx/src/library/dao/trackdao.h 2012-08-10 15:03:46 +0000 +++ mixxx/src/library/dao/trackdao.h 2012-12-12 14:41:42 +0000 @@ -75,6 +75,7 @@ void initialize(); int getTrackId(QString absoluteFilePath); + QList getTrackIds(QList files); bool trackExistsInDatabase(QString absoluteFilePath); QString getTrackLocation(int id); int addTrack(const QString& file, bool unremove); === modified file 'mixxx/src/library/itunes/itunesfeature.cpp' --- mixxx/src/library/itunes/itunesfeature.cpp 2012-11-22 06:59:01 +0000 +++ mixxx/src/library/itunes/itunesfeature.cpp 2012-12-12 14:41:42 +0000 @@ -192,14 +192,17 @@ } } -bool ITunesFeature::dropAccept(QList urls) { +bool ITunesFeature::dropAccept(QList urls, QWidget *pSource) { Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } -bool ITunesFeature::dropAcceptChild(const QModelIndex& index, QList urls) { +bool ITunesFeature::dropAcceptChild(const QModelIndex& index, QList urls + ,QWidget *pSource) { Q_UNUSED(index); Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/itunes/itunesfeature.h' --- mixxx/src/library/itunes/itunesfeature.h 2012-11-22 06:59:01 +0000 +++ mixxx/src/library/itunes/itunesfeature.h 2012-12-12 14:41:42 +0000 @@ -28,8 +28,8 @@ QVariant title(); QIcon getIcon(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls, QWidget *pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSouce); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); === modified file 'mixxx/src/library/libraryfeature.h' --- mixxx/src/library/libraryfeature.h 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/libraryfeature.h 2012-12-12 14:41:42 +0000 @@ -29,8 +29,8 @@ virtual QVariant title() = 0; virtual QIcon getIcon() = 0; - virtual bool dropAccept(QList urls) = 0; - virtual bool dropAcceptChild(const QModelIndex& index, QList urls) = 0; + virtual bool dropAccept(QList urls, QWidget *pSource) = 0; + virtual bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource) = 0; virtual bool dragMoveAccept(QUrl url) = 0; virtual bool dragMoveAcceptChild(const QModelIndex& index, QUrl url) = 0; === modified file 'mixxx/src/library/mixxxlibraryfeature.cpp' --- mixxx/src/library/mixxxlibraryfeature.cpp 2012-11-25 09:33:00 +0000 +++ mixxx/src/library/mixxxlibraryfeature.cpp 2012-12-12 14:41:42 +0000 @@ -161,25 +161,31 @@ Q_UNUSED(index); } -bool MixxxLibraryFeature::dropAccept(QList urls) { - QList files; - foreach (QUrl url, urls) { - // XXX: Possible WTF alert - Previously we thought we needed toString() here - // but what you actually want in any case when converting a QUrl to a file - // system path is QUrl::toLocalFile(). This is the second time we have - // flip-flopped on this, but I think toLocalFile() should work in any - // case. toString() absolutely does not work when you pass the result to a - files.append(url.toLocalFile()); +bool MixxxLibraryFeature::dropAccept(QList urls, QWidget *pSource) { + if (pSource) { + return false; + } else { + QList files; + foreach (QUrl url, urls) { + // XXX: Possible WTF alert - Previously we thought we needed toString() here + // but what you actually want in any case when converting a QUrl to a file + // system path is QUrl::toLocalFile(). This is the second time we have + // flip-flopped on this, but I think toLocalFile() should work in any + // case. toString() absolutely does not work when you pass the result to a + files.append(url.toLocalFile()); + } + + // Adds track, does not insert duplicates, handles unremoving logic. + QList trackIds = m_trackDao.addTracks(files, true); + return trackIds.size() > 0; } - - // Adds track, does not insert duplicates, handles unremoving logic. - QList trackIds = m_trackDao.addTracks(files, true); - return trackIds.size() > 0; } -bool MixxxLibraryFeature::dropAcceptChild(const QModelIndex& index, QList urls) { +bool MixxxLibraryFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget *pSource) { Q_UNUSED(urls); Q_UNUSED(index); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/mixxxlibraryfeature.h' --- mixxx/src/library/mixxxlibraryfeature.h 2012-11-20 03:42:07 +0000 +++ mixxx/src/library/mixxxlibraryfeature.h 2012-12-12 14:41:42 +0000 @@ -25,8 +25,8 @@ QVariant title(); QIcon getIcon(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls, QWidget *pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); TreeItemModel* getChildModel(); === modified file 'mixxx/src/library/playlistfeature.cpp' --- mixxx/src/library/playlistfeature.cpp 2012-10-04 16:12:59 +0000 +++ mixxx/src/library/playlistfeature.cpp 2012-12-12 14:41:42 +0000 @@ -82,7 +82,8 @@ menu.exec(globalPos); } -bool PlaylistFeature::dropAcceptChild(const QModelIndex& index, QList urls){ +bool PlaylistFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget *pSource){ //TODO: Filter by supported formats regex and reject anything that doesn't match. QString playlistName = index.data().toString(); int playlistId = m_playlistDao.getPlaylistIdFromName(playlistName); @@ -97,11 +98,16 @@ files.append(url.toLocalFile()); } - // If a track is dropped onto a playlist's name, but the track isn't in the - // library, then add the track to the library before adding it to the - // playlist. - // Adds track, does not insert duplicates, handles unremoving logic. - QList trackIds = m_trackDao.addTracks(files, true); + QList trackIds; + if (pSource) { + trackIds = m_pTrackCollection->getTrackDAO().getTrackIds(files); + } else { + // If a track is dropped onto a playlist's name, but the track isn't in the + // library, then add the track to the library before adding it to the + // playlist. + // Adds track, does not insert duplicates, handles unremoving logic. + trackIds = m_pTrackCollection->getTrackDAO().addTracks(files, true); + } // remove tracks that could not be added for (int trackId =0; trackId urls); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); public slots: === modified file 'mixxx/src/library/preparefeature.cpp' --- mixxx/src/library/preparefeature.cpp 2012-12-05 23:12:36 +0000 +++ mixxx/src/library/preparefeature.cpp 2012-12-12 14:41:42 +0000 @@ -96,14 +96,17 @@ Q_UNUSED(index); } -bool PrepareFeature::dropAccept(QList urls) { +bool PrepareFeature::dropAccept(QList urls, QWidget *pSource) { Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } -bool PrepareFeature::dropAcceptChild(const QModelIndex& index, QList urls){ +bool PrepareFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget *pSource){ Q_UNUSED(index); Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/preparefeature.h' --- mixxx/src/library/preparefeature.h 2012-12-05 23:12:36 +0000 +++ mixxx/src/library/preparefeature.h 2012-12-12 14:41:42 +0000 @@ -26,8 +26,8 @@ QVariant title(); QIcon getIcon(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls, QWidget *pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); === modified file 'mixxx/src/library/promotracksfeature.cpp' --- mixxx/src/library/promotracksfeature.cpp 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/promotracksfeature.cpp 2012-12-12 14:41:42 +0000 @@ -188,14 +188,17 @@ Q_UNUSED(index); } -bool PromoTracksFeature::dropAccept(QList urls) { +bool PromoTracksFeature::dropAccept(QList urls, QWidget *pSource) { + Q_UNUSED(pSource); Q_UNUSED(urls); return false; } -bool PromoTracksFeature::dropAcceptChild(const QModelIndex& index, QList urls) { +bool PromoTracksFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget *pSource) { Q_UNUSED(index); Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/promotracksfeature.h' --- mixxx/src/library/promotracksfeature.h 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/promotracksfeature.h 2012-12-12 14:41:42 +0000 @@ -50,8 +50,8 @@ QVariant title(); QIcon getIcon(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls, QWidget *pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); === modified file 'mixxx/src/library/recording/recordingfeature.cpp' --- mixxx/src/library/recording/recordingfeature.cpp 2012-11-29 04:31:48 +0000 +++ mixxx/src/library/recording/recordingfeature.cpp 2012-12-12 14:41:42 +0000 @@ -67,14 +67,17 @@ this, SIGNAL(restoreSearch(QString))); } -bool RecordingFeature::dropAccept(QList urls) { +bool RecordingFeature::dropAccept(QList urls, QWidget *pSource) { Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } -bool RecordingFeature::dropAcceptChild(const QModelIndex& index, QList urls) { +bool RecordingFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget *pSource) { Q_UNUSED(index); Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/recording/recordingfeature.h' --- mixxx/src/library/recording/recordingfeature.h 2012-11-29 04:31:48 +0000 +++ mixxx/src/library/recording/recordingfeature.h 2012-12-12 14:41:42 +0000 @@ -28,8 +28,8 @@ QVariant title(); QIcon getIcon(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls, QWidget *pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); void bindWidget(WLibrary* libraryWidget, === modified file 'mixxx/src/library/rhythmbox/rhythmboxfeature.cpp' --- mixxx/src/library/rhythmbox/rhythmboxfeature.cpp 2012-11-22 06:59:01 +0000 +++ mixxx/src/library/rhythmbox/rhythmboxfeature.cpp 2012-12-12 14:41:42 +0000 @@ -129,14 +129,17 @@ emit(showTrackModel(m_pRhythmboxPlaylistModel)); } -bool RhythmboxFeature::dropAccept(QList urls) { +bool RhythmboxFeature::dropAccept(QList urls, QWidget *pSource) { Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } -bool RhythmboxFeature::dropAcceptChild(const QModelIndex& index, QList urls) { +bool RhythmboxFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget *pSource) { Q_UNUSED(index); Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/rhythmbox/rhythmboxfeature.h' --- mixxx/src/library/rhythmbox/rhythmboxfeature.h 2012-11-22 06:59:01 +0000 +++ mixxx/src/library/rhythmbox/rhythmboxfeature.h 2012-12-12 14:41:42 +0000 @@ -28,8 +28,8 @@ QVariant title(); QIcon getIcon(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls, QWidget *pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); === modified file 'mixxx/src/library/setlogfeature.cpp' --- mixxx/src/library/setlogfeature.cpp 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/setlogfeature.cpp 2012-12-12 14:41:42 +0000 @@ -126,9 +126,11 @@ menu.exec(globalPos); } -bool SetlogFeature::dropAcceptChild(const QModelIndex& index, QList urls){ +bool SetlogFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget *pSource){ Q_UNUSED(urls); Q_UNUSED(index); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/setlogfeature.h' --- mixxx/src/library/setlogfeature.h 2012-11-25 20:31:37 +0000 +++ mixxx/src/library/setlogfeature.h 2012-12-12 14:41:42 +0000 @@ -24,7 +24,7 @@ QVariant title(); QIcon getIcon(); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); virtual void bindWidget(WLibrary* libraryWidget, === modified file 'mixxx/src/library/sidebarmodel.cpp' --- mixxx/src/library/sidebarmodel.cpp 2012-11-27 05:18:17 +0000 +++ mixxx/src/library/sidebarmodel.cpp 2012-12-12 14:41:42 +0000 @@ -247,16 +247,17 @@ } } -bool SidebarModel::dropAccept(const QModelIndex& index, QList urls) { +bool SidebarModel::dropAccept(const QModelIndex& index, QList urls, + QWidget* pSource) { //qDebug() << "SidebarModel::dropAccept() index=" << index << url; if (index.isValid()) { if (index.internalPointer() == this) { - return m_sFeatures[index.row()]->dropAccept(urls); + return m_sFeatures[index.row()]->dropAccept(urls, pSource); } else { TreeItem* tree_item = (TreeItem*)index.internalPointer(); if (tree_item) { LibraryFeature* feature = tree_item->getFeature(); - return feature->dropAcceptChild(index, urls); + return feature->dropAcceptChild(index, urls,pSource); } } } === modified file 'mixxx/src/library/sidebarmodel.h' --- mixxx/src/library/sidebarmodel.h 2012-07-25 17:20:41 +0000 +++ mixxx/src/library/sidebarmodel.h 2012-12-12 14:41:42 +0000 @@ -30,7 +30,7 @@ int columnCount(const QModelIndex& parent = QModelIndex()) const; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole ) const; - bool dropAccept(const QModelIndex& index, QList urls); + bool dropAccept(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(const QModelIndex& index, QUrl url); virtual bool hasChildren ( const QModelIndex & parent = QModelIndex() ) const; === modified file 'mixxx/src/library/traktor/traktorfeature.cpp' --- mixxx/src/library/traktor/traktorfeature.cpp 2012-11-22 06:59:01 +0000 +++ mixxx/src/library/traktor/traktorfeature.cpp 2012-12-12 14:41:42 +0000 @@ -162,14 +162,17 @@ } } -bool TraktorFeature::dropAccept(QList urls) { +bool TraktorFeature::dropAccept(QList urls, QWidget *pSource) { Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } -bool TraktorFeature::dropAcceptChild(const QModelIndex& index, QList urls) { +bool TraktorFeature::dropAcceptChild(const QModelIndex& index, QList urls, + QWidget *pSource) { Q_UNUSED(index); Q_UNUSED(urls); + Q_UNUSED(pSource); return false; } === modified file 'mixxx/src/library/traktor/traktorfeature.h' --- mixxx/src/library/traktor/traktorfeature.h 2012-11-22 06:59:01 +0000 +++ mixxx/src/library/traktor/traktorfeature.h 2012-12-12 14:41:42 +0000 @@ -44,8 +44,8 @@ QVariant title(); QIcon getIcon(); static bool isSupported(); - bool dropAccept(QList urls); - bool dropAcceptChild(const QModelIndex& index, QList urls); + bool dropAccept(QList urls, QWidget *pSource); + bool dropAcceptChild(const QModelIndex& index, QList urls, QWidget *pSource); bool dragMoveAccept(QUrl url); bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); === modified file 'mixxx/src/widget/wlibrarysidebar.cpp' --- mixxx/src/widget/wlibrarysidebar.cpp 2012-07-25 17:20:41 +0000 +++ mixxx/src/widget/wlibrarysidebar.cpp 2012-12-12 14:41:42 +0000 @@ -116,7 +116,7 @@ SidebarModel* sidebarModel = dynamic_cast(model()); if (sidebarModel) { QModelIndex destIndex = indexAt(event->pos()); - if (sidebarModel->dropAccept(destIndex, urls)) { + if (sidebarModel->dropAccept(destIndex, urls, event->source())) { event->acceptProposedAction(); } else { event->ignore();