Skip to content

Commit

Permalink
WLibrary/WTrackTableView: fix & tweak some debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed May 3, 2022
1 parent b849d58 commit 4890db8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/widget/wlibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ bool WLibrary::registerView(const QString& name, QWidget* view) {
return false;
}
if (dynamic_cast<LibraryView*>(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;
}
Expand All @@ -58,8 +58,8 @@ void WLibrary::switchToView(const QString& name) {
if (widget != nullptr) {
LibraryView * lview = dynamic_cast<LibraryView*>(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;
}
Expand All @@ -80,8 +80,8 @@ void WLibrary::search(const QString& name) {
QWidget* current = currentWidget();
LibraryView* view = dynamic_cast<LibraryView*>(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();
Expand Down
9 changes: 5 additions & 4 deletions src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,13 +963,13 @@ bool WTrackTableView::isTrackInCurrentView(const TrackId& trackId) {
void WTrackTableView::setSelectedTracks(const QList<TrackId>& 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;
}

Expand All @@ -986,17 +986,18 @@ void WTrackTableView::setSelectedTracks(const QList<TrackId>& 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<int> trackRows = pTrackModel->getTrackRows(trackId);
if (trackRows.empty()) {
qDebug() << "WTrackTableView: track" << trackId << "is not in current view";
return false;
}

Expand Down

0 comments on commit 4890db8

Please sign in to comment.