summaryrefslogtreecommitdiffstats
path: root/src/widget/wlibrarysidebar.cpp
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2018-03-25 10:49:41 +0200
committerDaniel Schürmann <daschuer@mixxx.org>2018-03-25 10:49:41 +0200
commitb7215bcb09baa614ba32a2d5fb8a0f4ce801b25e (patch)
treeae25ccff3c6043c40e3685874db7164aec05a0f0 /src/widget/wlibrarysidebar.cpp
parent0b0c98a4f01223202a21e265e4c20558e7f67d23 (diff)
GoToItem now switches to the track table if the tree knot has a track table
Diffstat (limited to 'src/widget/wlibrarysidebar.cpp')
-rw-r--r--src/widget/wlibrarysidebar.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/widget/wlibrarysidebar.cpp b/src/widget/wlibrarysidebar.cpp
index 700c444a85..23fc7396aa 100644
--- a/src/widget/wlibrarysidebar.cpp
+++ b/src/widget/wlibrarysidebar.cpp
@@ -82,7 +82,7 @@ void WLibrarySidebar::dragMoveEvent(QDragMoveEvent * event) {
if (sidebarModel) {
accepted = false;
for (const QUrl& url : urls) {
- QModelIndex destIndex = this->indexAt(event->pos());
+ QModelIndex destIndex = indexAt(event->pos());
if (sidebarModel->dragMoveAccept(destIndex, url)) {
// We only need one URL to be valid for us
// to accept the whole drag...
@@ -170,7 +170,13 @@ bool WLibrarySidebar::isLeafNodeSelected() {
QModelIndexList selectedIndices = this->selectionModel()->selectedRows();
if (selectedIndices.size() > 0) {
QModelIndex index = selectedIndices.at(0);
- return !index.model()->hasChildren(index);
+ if(!index.model()->hasChildren(index)) {
+ return true;
+ }
+ const SidebarModel* sidebarModel = dynamic_cast<const SidebarModel*>(index.model());
+ if (sidebarModel) {
+ return sidebarModel->hasTrackTable(index);
+ }
}
return false;
}