| 113 | } |
| 114 | |
| 115 | void GameListModel::updateCacheSize(int width, int height) |
| 116 | { |
| 117 | // This is a bit conversative, since it doesn't consider padding, but better to be over than under. |
| 118 | const int cover_width = getCoverArtWidth(); |
| 119 | const int cover_height = getCoverArtHeight(); |
| 120 | const int num_columns = ((width + (cover_width - 1)) / cover_width); |
| 121 | const int num_rows = ((height + (cover_height - 1)) / cover_height); |
| 122 | m_cover_pixmap_cache.SetMaxCapacity(static_cast<int>(std::max(num_columns * num_rows, MIN_COVER_CACHE_SIZE))); |
| 123 | } |
| 124 | |
| 125 | void GameListModel::setDevicePixelRatio(qreal dpr) |
| 126 | { |
no test coverage detected