fix: loading cached icon from disk when disk cache is disabled

This commit is contained in:
Vinicius Moreira
2019-07-11 18:24:57 -03:00
parent 23819aea46
commit a9e3d13aa0

View File

@@ -236,9 +236,8 @@ class AppsTable(QTableWidget):
col.setText(app_v.model.base_data.name if app_v.model.base_data.name else '...')
col.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
if app_v.model.supports_disk_cache() and os.path.exists(app_v.model.get_disk_icon_path()):
with open (app_v.model.get_disk_icon_path(), 'rb') as f:
if self.disk_cache and app_v.model.supports_disk_cache() and os.path.exists(app_v.model.get_disk_icon_path()):
with open(app_v.model.get_disk_icon_path(), 'rb') as f:
icon_bytes = f.read()
pixmap = QPixmap()
pixmap.loadFromData(icon_bytes)