diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bde2716..44730981 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Runtimes update-checking for version 1.5.X - Snap: - retrieving installed applications information for Ubuntu based distros +- Application icon replaced by the type icon in the Info, History and Screenshots panels due to unexpected Qt crashes. - minor UI fixes ### AppImage support diff --git a/bauh/view/qt/history.py b/bauh/view/qt/history.py index 7e441498..78fe283c 100644 --- a/bauh/view/qt/history.py +++ b/bauh/view/qt/history.py @@ -2,7 +2,7 @@ import operator from functools import reduce from PyQt5.QtCore import Qt -from PyQt5.QtGui import QColor +from PyQt5.QtGui import QColor, QIcon from PyQt5.QtWidgets import QDialog, QVBoxLayout, QTableWidget, QTableWidgetItem, QHeaderView from bauh.api.abstract.cache import MemoryCache @@ -55,7 +55,9 @@ class HistoryDialog(QDialog): new_width = reduce(operator.add, [table_history.columnWidth(i) for i in range(table_history.columnCount())]) self.resize(new_width, table_history.height()) - icon_data = icon_cache.get(history.pkg.icon_url) - - if icon_data and icon_data.get('icon'): - self.setWindowIcon(icon_data.get('icon')) + # THERE ARE CRASHES WITH SOME RARE ICONS ( like insomnia ). IT CAN BE A QT BUG. IN THE MEANTIME, ONLY THE TYPE ICON WILL BE RENDERED + # + # icon_data = icon_cache.get(history.pkg.icon_url) + # if icon_data and icon_data.get('icon'): + # self.setWindowIcon(icon_data.get('icon')) + self.setWindowIcon(QIcon(history.pkg.get_type_icon_path())) diff --git a/bauh/view/qt/info.py b/bauh/view/qt/info.py index e2818c30..b9bbb11c 100644 --- a/bauh/view/qt/info.py +++ b/bauh/view/qt/info.py @@ -37,12 +37,13 @@ class InfoDialog(QDialog): layout.addWidget(self.gbox_info) - icon_data = icon_cache.get(app['__app__'].model.icon_url) - - if icon_data and icon_data.get('icon'): - self.setWindowIcon(icon_data.get('icon')) - else: - self.setWindowIcon(QIcon(app['__app__'].model.get_type_icon_path())) + # THERE ARE CRASHES WITH SOME RARE ICONS ( like insomnia ). IT CAN BE A QT BUG. IN THE MEANTIME, ONLY THE TYPE ICON WILL BE RENDERED + # + # icon_data = icon_cache.get(app['__app__'].model.icon_url) + # + # if icon_data and icon_data.get('icon'): + # self.setWindowIcon(icon_data.get('icon')) + self.setWindowIcon(QIcon(app['__app__'].model.get_type_icon_path())) for idx, attr in enumerate(sorted(app.keys())): if attr not in IGNORED_ATTRS and app[attr]: diff --git a/bauh/view/qt/screenshots.py b/bauh/view/qt/screenshots.py index dd2870eb..8f8dea43 100644 --- a/bauh/view/qt/screenshots.py +++ b/bauh/view/qt/screenshots.py @@ -29,13 +29,15 @@ class ScreenshotsDialog(QDialog): self.i18n = i18n self.http_client = http_client - icon_data = icon_cache.get(pkg.model.icon_url) - - if icon_data and icon_data.get('icon'): - self.setWindowIcon(icon_data.get('icon')) - else: - self.setWindowIcon(QIcon(pkg.model.get_type_icon_path())) - + # THERE ARE CRASHES WITH SOME RARE ICONS ( like insomnia ). IT CAN BE A QT BUG. IN THE MEANTIME, ONLY THE TYPE ICON WILL BE RENDERED + # + # icon_data = icon_cache.get(pkg.model.icon_url) + # + # if icon_data and icon_data.get('icon'): + # self.setWindowIcon(icon_data.get('icon')) + # else: + # self.setWindowIcon(QIcon(pkg.model.get_type_icon_path())) + self.setWindowIcon(QIcon(pkg.model.get_type_icon_path())) self.setLayout(QVBoxLayout()) self.img = QLabel()