diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2015-01-02 00:01:07 +0100 |
---|---|---|
committer | Daniel Schürmann <daschuer@mixxx.org> | 2015-01-02 00:01:07 +0100 |
commit | 4fb09a915df5dc42dd62973e5da35a1cc7b04610 (patch) | |
tree | d7c8d9e8b7ee7c81b9588f78e748c5849a29b7d0 /src | |
parent | 6329431cde7959a94cdf9c755550afae78157d0b (diff) |
Speed up drop to library oprations
Diffstat (limited to 'src')
-rw-r--r-- | src/soundsourceproxy.cpp | 2 | ||||
-rw-r--r-- | src/widget/wlibrarysidebar.cpp | 14 | ||||
-rw-r--r-- | src/widget/wtracktableview.cpp | 6 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/soundsourceproxy.cpp b/src/soundsourceproxy.cpp index 7bbb7d2c4d..d396b2e993 100644 --- a/src/soundsourceproxy.cpp +++ b/src/soundsourceproxy.cpp @@ -392,7 +392,7 @@ QString SoundSourceProxy::supportedFileExtensionsRegex() { // static bool SoundSourceProxy::isFilenameSupported(QString fileName) { - if (m_supportedFileRegex.isValid()) { + if (m_supportedFileRegex.isEmpty()) { QString regex = SoundSourceProxy::supportedFileExtensionsRegex(); m_supportedFileRegex = QRegExp(regex, Qt::CaseInsensitive); } diff --git a/src/widget/wlibrarysidebar.cpp b/src/widget/wlibrarysidebar.cpp index cccef41693..a32f021732 100644 --- a/src/widget/wlibrarysidebar.cpp +++ b/src/widget/wlibrarysidebar.cpp @@ -84,13 +84,17 @@ void WLibrarySidebar::dragMoveEvent(QDragMoveEvent * event) { SidebarModel* sidebarModel = dynamic_cast<SidebarModel*>(model()); bool accepted = true; if (sidebarModel) { + accepted = false; foreach (QUrl url, urls) { QModelIndex destIndex = this->indexAt(event->pos()); - if (!sidebarModel->dragMoveAccept(destIndex, url)) { - //We only need one URL to be invalid for us - //to reject the whole drag... - //(eg. you may have tried to drag two MP3's and an EXE) - accepted = false; + if (sidebarModel->dragMoveAccept(destIndex, url)) { + // We only need one URL to be valid for us + // to accept the whole drag... + // consider we have a long list of valid files, checking all will + // take a lot of time that stales Mixxx and this makes the drop feature useless + // Eg. you may have tried to drag two MP3's and an EXE, the drop is accepted here, + // but the EXE is sorted out later after dropping + accepted = true; break; } } diff --git a/src/widget/wtracktableview.cpp b/src/widget/wtracktableview.cpp index 61c6943192..308c94ff65 100644 --- a/src/widget/wtracktableview.cpp +++ b/src/widget/wtracktableview.cpp @@ -987,7 +987,7 @@ void WTrackTableView::dragEnterEvent(QDragEnterEvent * event) { return; } } else if (DragAndDropHelper::dragEnterAccept(*event->mimeData(), - "library", false, true)) { + "library", true, true)) { event->acceptProposedAction(); return; } @@ -996,8 +996,8 @@ void WTrackTableView::dragEnterEvent(QDragEnterEvent * event) { } // Drag move event, happens when a dragged item hovers over the track table view... -// Why we need this is a little vague, but without it, drag-and-drop just doesn't work. -// -- Albert June 8/08 +// It changes the drop handle to a "+" when the drag content is acceptable. +// Without it, the following drop is ignored. void WTrackTableView::dragMoveEvent(QDragMoveEvent * event) { // Needed to allow auto-scrolling WLibraryTableView::dragMoveEvent(event); |