mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 08:34:17 +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 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
|
- 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
|
- 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
|
- minor fixes
|
||||||
- Tray
|
- Tray
|
||||||
- update notifications not working on Ubuntu 18.04
|
- update notifications not working on Ubuntu 18.04
|
||||||
|
|||||||
@@ -409,13 +409,16 @@ class AppsTable(QTableWidget):
|
|||||||
|
|
||||||
icon_path = pkg.model.get_disk_icon_path()
|
icon_path = pkg.model.get_disk_icon_path()
|
||||||
if pkg.model.installed and pkg.model.supports_disk_cache() and 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):
|
if icon_path.startswith('/'):
|
||||||
with open(icon_path, 'rb') as f:
|
if os.path.isfile(icon_path):
|
||||||
icon_bytes = f.read()
|
with open(icon_path, 'rb') as f:
|
||||||
pixmap = QPixmap()
|
icon_bytes = f.read()
|
||||||
pixmap.loadFromData(icon_bytes)
|
pixmap = QPixmap()
|
||||||
icon = QIcon(pixmap)
|
pixmap.loadFromData(icon_bytes)
|
||||||
self.icon_cache.add_non_existing(pkg.model.icon_url, {'icon': icon, 'bytes': 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:
|
else:
|
||||||
try:
|
try:
|
||||||
icon = QIcon.fromTheme(icon_path)
|
icon = QIcon.fromTheme(icon_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user