Skip to content

Commit

Permalink
DEBUG sidebar click
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Feb 7, 2025
1 parent 0238dc2 commit b750928
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/library/mixxxlibraryfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void MixxxLibraryFeature::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) {
#endif

void MixxxLibraryFeature::activate() {
//qDebug() << "MixxxLibraryFeature::activate()";
qDebug() << "MixxxLibraryFeature::activate()";
emit saveModelState();
emit showTrackModel(m_pLibraryTableModel);
emit enableCoverArtDisplay(true);
Expand Down
17 changes: 16 additions & 1 deletion src/library/sidebarmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,16 +332,31 @@ void SidebarModel::clicked(const QModelIndex& index) {
// invoked immediately before. That doesn't matter,
// because we stop any running timer before handling
// this event.
qWarning() << "SidebarModel::clicked" << index;
stopPressedUntilClickedTimer();
if (index.isValid()) {
qWarning() << " index valid";
if (index.internalPointer() == this) {
m_sFeatures[index.row()]->activate();
LibraryFeature* pFeature = m_sFeatures[index.row()];
if (!pFeature) {
qWarning() << " no assoc. LibraryFeature found !!";
return;
}
qWarning() << " index is root of"
<< pFeature->title().toString()
<< "-> activate()";
pFeature->activate();
} else {
TreeItem* pTreeItem = static_cast<TreeItem*>(index.internalPointer());
if (pTreeItem) {
qWarning() << " found assoc. TreeItem*:" << pTreeItem->getLabel();
LibraryFeature* pFeature = pTreeItem->feature();
DEBUG_ASSERT(pFeature);
qWarning() << " of feature" << pFeature->title().toString();
qWarning() << " -> activate()";
pFeature->activateChild(index);
} else {
qWarning() << " no assoc. TreeItem* found";
}
}
}
Expand Down

0 comments on commit b750928

Please sign in to comment.