Skip to content

Commit

Permalink
Improve code readability
Browse files Browse the repository at this point in the history
Co-authored-by: JoergAtGithub <[email protected]>
  • Loading branch information
daschuer and JoergAtGithub committed Nov 13, 2023
1 parent e19da2c commit b5cccbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/library/basetracktablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ QVariant BaseTrackTableModel::composeCoverArtToolTipHtml(
coverInfo,
absoluteHeightOfCoverartToolTip);
if (pixmap.isNull()) {
// Cache miss -> Request Cover via coverFound signal
// Cache miss -> Don't show a tooltip, refresh cache
// Height used for the width, in assumption that covers are squares
CoverArtCache::requestUncachedCover(
this,
coverInfo,
Expand Down
15 changes: 8 additions & 7 deletions src/library/coverartcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,19 @@ QPixmap CoverArtCache::getCachedCover(
QString cacheKey = pixmapCacheKey(requestedCacheKey, desiredWidth);

QPixmap pixmap;
if (QPixmapCache::find(cacheKey, &pixmap)) {
if (kLogger.traceEnabled()) {
kLogger.trace()
<< "requestCover cache hit"
<< coverInfo;
}
} else {
if (!QPixmapCache::find(cacheKey, &pixmap)) {
if (kLogger.traceEnabled()) {
kLogger.trace()
<< "requestCover cache miss"
<< coverInfo;
}
return QPixmap();
}

if (kLogger.traceEnabled()) {
kLogger.trace()
<< "requestCover cache hit"
<< coverInfo;
}
return pixmap;
}
Expand Down

0 comments on commit b5cccbb

Please sign in to comment.