Skip to content

Commit

Permalink
Don't look up cover infos for not visible covers
Browse files Browse the repository at this point in the history
Co-authored-by: ronso0 <[email protected]>
  • Loading branch information
daschuer and ronso0 committed Oct 4, 2024
1 parent 18d556d commit 070dbb0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/library/coverartdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void CoverArtDelegate::requestUncachedCover(
void CoverArtDelegate::slotInhibitLazyLoading(
bool inhibitLazyLoading) {
m_inhibitLazyLoading = inhibitLazyLoading;
if (m_inhibitLazyLoading) {
if (m_inhibitLazyLoading || m_cacheMissRows.isEmpty()) {
return;
}
VERIFY_OR_DEBUG_ASSERT(m_pTrackModel) {
Expand All @@ -86,10 +86,10 @@ void CoverArtDelegate::slotInhibitLazyLoading(
const int width = static_cast<int>(m_pTableView->columnWidth(m_column) * scaleFactor);

for (int row : std::as_const(m_cacheMissRows)) {
QModelIndex index = m_pTableView->model()->index(row, m_column);
CoverInfo coverInfo = m_pTrackModel->getCoverInfo(index);
QRect rect = m_pTableView->visualRect(index);
const QModelIndex index = m_pTableView->model()->index(row, m_column);
const QRect rect = m_pTableView->visualRect(index);
if (rect.intersects(m_pTableView->rect())) {
const CoverInfo coverInfo = m_pTrackModel->getCoverInfo(index);
requestUncachedCover(coverInfo, width, row);
}
}
Expand Down

0 comments on commit 070dbb0

Please sign in to comment.