diff --git a/CHANGELOG.md b/CHANGELOG.md index c5fef143..6085403d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - new environment variable / argument to enable / disable the tray icon and update-check daemon: FPAKMAN_TRAY (--tray) - search results sorting takes an average of 35% less time, reaching 60% in some scenarios ### Fixes: +- apps table not showing empty descriptions - replacing default app icons by null icons - i18n fixes diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index 6e05e5be..7af634a2 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -11,6 +11,8 @@ from fpakman_api.abstract.model import ApplicationStatus from fpakman.core import resource from fpakman_api.util.cache import Cache + +from fpakman.util import util from fpakman.view.qt import dialog from fpakman.view.qt.view_model import ApplicationView, ApplicationViewStatus @@ -292,10 +294,16 @@ class AppsTable(QTableWidget): def _set_col_description(self, idx: int, app_v: ApplicationView): col = QTableWidgetItem() col.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) - desc = app_v.get_async_attr('description', strip_html=True) - if desc: - col.setText(desc[0:25] + '...') + if app_v.model.base_data.description is not None or app_v.model.is_library() or app_v.model.status == ApplicationStatus.READY: + desc = app_v.model.base_data.description + else: + desc = '...' + + if desc and desc != '...': + desc = util.strip_html(desc[0:25]) + '...' + + col.setText(desc) if app_v.model.status == ApplicationStatus.READY: col.setToolTip(desc) diff --git a/fpakman/view/qt/view_model.py b/fpakman/view/qt/view_model.py index ac49610f..11194255 100644 --- a/fpakman/view/qt/view_model.py +++ b/fpakman/view/qt/view_model.py @@ -17,12 +17,3 @@ class ApplicationView: self.update_checked = model.update self.visible = visible self.status = ApplicationViewStatus.LOADING - - def get_async_attr(self, attr: str, strip_html: bool = False, default: str = '...'): - - if getattr(self.model.base_data, attr) is not None or self.model.is_library(): - res = getattr(self.model.base_data, attr) - else: - res = getattr(self.model.base_data, attr) if self.model.status == ApplicationStatus.READY and getattr(self.model.base_data, attr) else default - - return util.strip_html(res) if res and strip_html else res