[ui] fix -> icons that cannot be rendered are being displayed as an empty space

This commit is contained in:
Vinicius Moreira
2020-08-21 16:19:27 -03:00
parent 634f3dc932
commit 5b85c3716f
2 changed files with 6 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- UI - UI
- crashing when nothing can be upgraded - crashing when nothing can be upgraded
- random C++ wrapper errors with some forms due to missing references - random C++ wrapper errors with some forms due to missing references
- icons that cannot be rendered are being displayed as an empty space (now the type icon is displayed instead)
## [0.9.6] 2020-06-26 ## [0.9.6] 2020-06-26

View File

@@ -426,7 +426,11 @@ class AppsTable(QTableWidget):
else: else:
try: try:
icon = QIcon.fromTheme(icon_path) icon = QIcon.fromTheme(icon_path)
self.icon_cache.add_non_existing(pkg.model.icon_url, {'icon': icon, 'bytes': None})
if icon.isNull():
icon = QIcon(pkg.model.get_default_icon_path())
else:
self.icon_cache.add_non_existing(pkg.model.icon_url, {'icon': icon, 'bytes': None})
except: except:
icon = QIcon(pkg.model.get_default_icon_path()) icon = QIcon(pkg.model.get_default_icon_path())