From 54deccf7c3548f8a2e20d747adf73585d7d9e2a8 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Mon, 9 May 2022 11:11:35 +0200 Subject: [PATCH] WLibrary/WTrackTableView: fix & tweak some debug messages --- src/widget/wlibrary.cpp | 13 +++++++------ src/widget/wtracktableview.cpp | 9 +++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/widget/wlibrary.cpp b/src/widget/wlibrary.cpp index 8767d93f129..f87fc1f3eb2 100644 --- a/src/widget/wlibrary.cpp +++ b/src/widget/wlibrary.cpp @@ -32,13 +32,14 @@ void WLibrary::setup(const QDomNode& node, const SkinContext& context) { } bool WLibrary::registerView(const QString& name, QWidget* view) { + //qDebug() << "WLibrary::registerView" << name; const auto lock = lockMutex(&m_mutex); if (m_viewMap.contains(name)) { return false; } if (dynamic_cast(view) == nullptr) { - qDebug() << "WARNING: Attempted to register a view with WLibrary " - << "that does not implement the LibraryView interface. " + qDebug() << "WARNING: Attempted to register view" << name << "with WLibrary " + << "which does not implement the LibraryView interface. " << "Ignoring."; return false; } @@ -58,8 +59,8 @@ void WLibrary::switchToView(const QString& name) { if (widget != nullptr) { LibraryView * lview = dynamic_cast(widget); if (lview == nullptr) { - qDebug() << "WARNING: Attempted to register a view with WLibrary " - << "that does not implement the LibraryView interface. " + qDebug() << "WARNING: Attempted to switch to view" << name << "with WLibrary " + << "which does not implement the LibraryView interface. " << "Ignoring."; return; } @@ -80,8 +81,8 @@ void WLibrary::search(const QString& name) { QWidget* current = currentWidget(); LibraryView* view = dynamic_cast(current); if (view == nullptr) { - qDebug() << "WARNING: Attempted to register a view with WLibrary " - << "that does not implement the LibraryView interface. Ignoring."; + qDebug() << "WARNING: Attempted to search in view" << name << "with WLibrary " + << "which does not implement the LibraryView interface. Ignoring."; return; } lock.unlock(); diff --git a/src/widget/wtracktableview.cpp b/src/widget/wtracktableview.cpp index 6214ffadfe3..1f804706745 100644 --- a/src/widget/wtracktableview.cpp +++ b/src/widget/wtracktableview.cpp @@ -965,13 +965,13 @@ bool WTrackTableView::isTrackInCurrentView(const TrackId& trackId) { void WTrackTableView::setSelectedTracks(const QList& trackIds) { QItemSelectionModel* pSelectionModel = selectionModel(); VERIFY_OR_DEBUG_ASSERT(pSelectionModel != nullptr) { - qWarning() << "No selected tracks available"; + qWarning() << "No selection model"; return; } TrackModel* pTrackModel = getTrackModel(); VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) { - qWarning() << "No selected tracks available"; + qWarning() << "No track model"; return; } @@ -988,17 +988,18 @@ void WTrackTableView::setSelectedTracks(const QList& trackIds) { bool WTrackTableView::setCurrentTrackId(const TrackId& trackId, int column, bool scrollToTrack) { QItemSelectionModel* pSelectionModel = selectionModel(); VERIFY_OR_DEBUG_ASSERT(pSelectionModel != nullptr) { - qWarning() << "No selected tracks available"; + qWarning() << "No selection model"; return false; } TrackModel* pTrackModel = getTrackModel(); VERIFY_OR_DEBUG_ASSERT(pTrackModel != nullptr) { - qWarning() << "No selected tracks available"; + qWarning() << "No track model"; return false; } const QVector trackRows = pTrackModel->getTrackRows(trackId); if (trackRows.empty()) { + qDebug() << "WTrackTableView: track" << trackId << "is not in current view"; return false; }