mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[fix][ui] not displaying the default type icon besides the package when its icon path does not exist
This commit is contained in:
@@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- not calling initial required tasks after enabling a new package type on settings
|
||||
- not updating the type filters if only type is available after refreshing the table
|
||||
- displaying the type filters on the search results when there is only one type available and some actions are done
|
||||
- not displaying the default type icon besides the package when its icon path does not exist (Snap runtimes are not displaying icons)
|
||||
- minor fixes
|
||||
- Tray
|
||||
- update notifications not working on Ubuntu 18.04
|
||||
|
||||
@@ -409,13 +409,16 @@ class AppsTable(QTableWidget):
|
||||
|
||||
icon_path = pkg.model.get_disk_icon_path()
|
||||
if pkg.model.installed and pkg.model.supports_disk_cache() and icon_path:
|
||||
if icon_path.startswith('/') and os.path.isfile(icon_path):
|
||||
with open(icon_path, 'rb') as f:
|
||||
icon_bytes = f.read()
|
||||
pixmap = QPixmap()
|
||||
pixmap.loadFromData(icon_bytes)
|
||||
icon = QIcon(pixmap)
|
||||
self.icon_cache.add_non_existing(pkg.model.icon_url, {'icon': icon, 'bytes': icon_bytes})
|
||||
if icon_path.startswith('/'):
|
||||
if os.path.isfile(icon_path):
|
||||
with open(icon_path, 'rb') as f:
|
||||
icon_bytes = f.read()
|
||||
pixmap = QPixmap()
|
||||
pixmap.loadFromData(icon_bytes)
|
||||
icon = QIcon(pixmap)
|
||||
self.icon_cache.add_non_existing(pkg.model.icon_url, {'icon': icon, 'bytes': icon_bytes})
|
||||
else:
|
||||
icon = QIcon(pkg.model.get_default_icon_path())
|
||||
else:
|
||||
try:
|
||||
icon = QIcon.fromTheme(icon_path)
|
||||
|
||||
Reference in New Issue
Block a user